]> source.dussan.org Git - sonarqube.git/commitdiff
Internationalization of SquidJava rules 9/head
authorDavid Festal <david.festal@serli.com>
Mon, 4 Jul 2011 15:04:08 +0000 (17:04 +0200)
committerDavid Festal <david.festal@serli.com>
Mon, 4 Jul 2011 20:57:35 +0000 (22:57 +0200)
plugins/sonar-squid-java-plugin/src/main/resources/org/sonar/i18n/squidjava.properties [new file with mode: 0644]

diff --git a/plugins/sonar-squid-java-plugin/src/main/resources/org/sonar/i18n/squidjava.properties b/plugins/sonar-squid-java-plugin/src/main/resources/org/sonar/i18n/squidjava.properties
new file mode 100644 (file)
index 0000000..65fd654
--- /dev/null
@@ -0,0 +1,44 @@
+rule.squid.ArchitecturalConstraint.name=Architectural constraint
+rule.squid.ArchitecturalConstraint.description=<p>A source code comply to an architectural model when it fully adheres to a set of architectural constraints. A constraint allows to deny references between classes by pattern.</p><p>You can for instance use this rule to :</p><ul><li>forbid access to **.web.** from **.dao.** classes</li><li>forbid access to java.util.Vector, java.util.Hashtable and java.util.Enumeration from any classes</li><li>forbid access to java.sql.** from **.ui.** and **.web.** classes</li></ul>
+rule.squid.AvoidBreakOutsideSwitch.name=Avoid using 'break' branching statement outside a 'switch' statement
+rule.squid.AvoidBreakOutsideSwitch.description=<p>The use of the 'break' branching statement increases the essential complexity of the source code and so prevents any refactoring of this source code to replace all well structured control structures with a single statement.</p><p>For instance, with the following java program fragment, it's not possible to apply the 'extract method' refactoring pattern :</p><pre>mylabel : for (int i = 0 ; i< 3; i++) {\
+  for (int j = 0; j < 4 ; j++) {\
+    doSomething();\
+    if (checkSomething()) {\
+      break mylabel;\
+    }\
+  }\
+}\
+</pre><p>The use of the 'break' branching statement is only authorized inside a 'switch' statement.</p>
+rule.squid.AvoidContinueStatement.name=Avoid using 'continue' branching statement
+rule.squid.AvoidContinueStatement.description=<p>The use of the 'continue' branching statement increase the essential complexity of the source code and so prevent any refactoring of this source code to replace all well structured control structures with a single statement.</p><p>For instance, in the following java program fragment, it's not possible to apply the 'extract method' refactoring pattern :</p><pre>mylabel : for(int i = 0 ; i< 3; i++) {\
+  for (int j = 0; j < 4 ; j++) {\
+    doSomething();\
+    if (checkSomething()) {\
+      continue mylabel;\
+    }\
+  }\
+}\
+</pre>
+rule.squid.CallToDeprecatedMethod.name=Avoid use of deprecated method
+rule.squid.CallToDeprecatedMethod.description=<p>Once deprecated, a method should no longer be used as it means that the method might be removed sooner or later.</p>
+rule.squid.ClassCyclomaticComplexity.name=Avoid too complex class
+rule.squid.ClassCyclomaticComplexity.description=<p>The Cyclomatic Complexity is measured by the number of (&&, ||) operators and (if, while, do, for, ?:, catch, switch, case, return, throw) statements in the body of a class plus one for each constructor, method (but not getter/setter), static initializer, or instance initializer in the class. The last return stament in method, if exists, is not taken into account.</p><p>Even when the Cyclomatic Complexity of a class is very high, this complexity might be well distributed among all methods. Nevertheless, most of the time, a very complex class is a class which breaks the <a href='http://en.wikipedia.org/wiki/Single_responsibility_principle'>Single Responsibility Principle</a> and which should be re-factored to be split in several classes.</p>
+rule.squid.EmptyFile.name=Empty file
+rule.squid.EmptyFile.description=Detect empty files, which do not have any lines of code. Example: <pre>\
+//package org.foo;\
+//\
+//public class Bar {}\
+</pre>
+rule.squid.MaximumInheritanceDepth.name=Avoid too deep inheritance tree
+rule.squid.MaximumInheritanceDepth.description=<p>Inheritance is certainly one of the most valuable concept of object-oriented programming. It's a way to compartmentalize and reuse code by creating collections of attributes and behaviors called classes which can be based on previously created classes. But abusing of this concept by creating a deep inheritance tree can lead to very complex and unmaintainable source code.</p><p>Most of the time a too deep inheritance tree is due to bad object oriented design which has led to systematically use 'inheritance' when 'composition' would suit better.</p>
+rule.squid.MethodCyclomaticComplexity.name=Avoid too complex method
+rule.squid.MethodCyclomaticComplexity.description=<p>The Cyclomatic Complexity is measured by the number of (&&, ||) operators and (if, while, do, for, ?:, catch, switch, case, return, throw) statements in the body of a constructor, method, static initializer, or instance initializer. The minimun Cyclomatic Complexity of a method is 1 and the last return stament, if exists, is not taken into account. The more complex is a method, the more possible different paths through the source code exist. Generally 1-4 is considered good, 5-7 ok, 8-10 consider re-factoring, and 11+ re-factor now. Indeed above 10, it's pretty difficult to be able to think about all possible paths when maintaining the source code, so the risk of regression increases exponentially.</p>
+rule.squid.NoSonar.name=Avoid use of //NOSONAR marker
+rule.squid.NoSonar.description=<p>Any violation to quality rule can be deactivated with the //NOSONAR marker. This marker is pretty useful to exclude false-positive results but sometimes it can abusively be used to hide real quality flaws.</p><p>This rule allows to track and/or forbid use of this marker</p>
+rule.squid.UndocumentedApi.name=Undocumented API
+rule.squid.UndocumentedApi.description=<p>Check that each public class, interface, method and constructor has a Javadoc comment. The following public methods/constructors are not concerned by this rule :</p><ul><li>Getter / Setter</li><li>Method with @Override annotation</li><li>Empty constructor</li></ul>
+rule.squid.UnusedPrivateMethod.name=Unused private method
+rule.squid.UnusedPrivateMethod.description=<p>Private methods that are never executed are dead code. Dead code means unnecessary, inoperative code that should be removed. This helps in maintenance by decreasing the maintained code size, making it easier to understand the program and preventing bugs from being introduced.</p><p>In the following two cases, private methods are not considered as dead code by Sonar :</p><ul><li>Private empty constructors that are intentionally used to prevent any direct instantiation of a class.</li><li>Private methods : readObject(...), writeObject(...), writeReplace(...), readResolve(...) which can contractually be used when implementing the Serializable interface.</li></ul>
+rule.squid.UnusedProtectedMethod.name=Unused protected method
+rule.squid.UnusedProtectedMethod.description=<p>Protected methods that are never used by any classes in the same project are strongly suspected to be dead code. Dead code means unnecessary, inoperative code that should be removed. This helps in maintenance by decreasing the maintained code size, making it easier to understand the program and preventing bugs from being introduced.</p><p>In the following case, unused protected methods are not considered as dead code by Sonar :</p><ul><li>Protected methods which override a method from a parent class.</li></ul><ul><li>Protected methods of an abstract class.</li></ul>