Skip to content

Commit

Permalink
Merge pull request #64 from ICTU/add-rules-for-too-many-lines
Browse files Browse the repository at this point in the history
Add rules for checks for too many lines. Fixes #63
  • Loading branch information
wkoot authored Dec 22, 2023
2 parents b9a02d7 + db3882d commit 791dd0b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions rules/cs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
+csharpsquid:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)
+csharpsquid:S1309 # Violation suppression; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)
+csharpsquid:S1541|maximumFunctionComplexityThreshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)
+csharpsquid:S1151 # Switch case clauses should not have too many lines of code. Used by Quality-time
#end please ensure every rule ends with a new line character
5 changes: 5 additions & 0 deletions rules/java.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
+java:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)
+java:S107|max=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)
+java:S125 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#commented-out-code)
+java:S104 # Files should not have too many lines of code. Used by Quality-time
+java:S1151 # Switch case clauses should not have too many lines of code. Used by Quality-time
+java:S1188 # Anonymous classes should not have too many lines. Used by Quality-time
+java:S2972 # Inner classes should not have too many lines of code. Used by Quality-time
+java:S5612 # Lambdas should not have too many lines. Used by Quality-time
#end please ensure every rule ends with a new line character
1 change: 1 addition & 0 deletions rules/js.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
+javascript:S109 # Magic numbers; NOT used by Quality-time
+javascript:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)
+javascript:S125 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#commented-out-code)
+javascript:S104 # Files should not have too many lines of code. Used by Quality-time
# Missing: NoSonar, NCSS, Parameters
#end please ensure every rule ends with a new line character
3 changes: 3 additions & 0 deletions rules/kotlin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
+kotlin:S1067 # Expression too complex; NOT used by Quality-time
+kotlin:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)
+kotlin:S107|Max=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)
+kotlin:S104 # Files should not have too many lines of code. Used by Quality-time
+kotlin:S1151 # When clauses should not have too many lines of code. Used by Quality-time
+kotlin:S5612 # Lambdas should not have too many lines. Used by Quality-time
4 changes: 4 additions & 0 deletions rules/swift.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
+swift:S138|max=20 # Methods with too many lines; used by Quality-time (https://github.com/ICTU/quality-time/blob/master/docs/METRICS_AND_SOURCES.md#long-units-from-sonarqube)
+swift:S107|functionMax=5 # Too many parameters; used by Quality-time (https://github.com/ICTU/quality-time/blob/master/docs/METRICS_AND_SOURCES.md#many-parameters-from-sonarqube)
+swift:S125 # Used by Quality-time (https://github.com/ICTU/quality-time/blob/master/docs/METRICS_AND_SOURCES.md#commented-out-code-from-sonarqube)
+swift:S104 # Files should not have too many lines of code. Used by Quality-time
+swift:S1151 # Switch case clauses should not have too many lines of code. Used by Quality-time
+swift:S1188 # Closures should not have too many lines. Used by Quality-time
+swift:S2042 # Classes should not have too many lines of code. Used by Quality-time
#end please ensure every rule ends with a new line character
2 changes: 2 additions & 0 deletions rules/vbnet.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
+vbnet:S1067 # Expression too complex; NOT used by Quality-time
+vbnet:S107|max=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)
+vbnet:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)
+vbnet:S104 # Files should not have too many lines of code. Used by Quality-time
+vbnet:S1151 # Select Case clauses should not have too many lines of code. Used by Quality-time
# Missing: method length, NoSonar, too many parameters, commented loc
#end please ensure every rule ends with a new line character
1 change: 1 addition & 0 deletions rules/web.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
+Web:ComplexityCheck # NOT used by Quality-time. Rule is deprecated, see https://rules.sonarsource.com/html/RSPEC-1908?search=complexity
+Web:LongJavaScriptCheck # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)
+Web:AvoidCommentedOutCodeCheck # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#commented-out-code)
+Web:FileLengthCheck # Files should not have too many lines. Used by Quality-time
#end please ensure every rule ends with a new line character

0 comments on commit 791dd0b

Please sign in to comment.