Skip to content

Commit

Permalink
Test based on config data
Browse files Browse the repository at this point in the history
  • Loading branch information
wkoot committed Mar 5, 2024
1 parent 2150ea6 commit e4fdb86
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
CODE: "PROJ1"
RULES: "+csharpsquid:S104;-ts:S1561"
RULES: "+csharpsquid:S104;-ts:S1561;+Web:WhiteSpaceAroundCheck"

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
SONAR_JDBC_PASSWORD: "sonar_pass"
SONARQUBE_PASSWORD: "admin123"
PROJECT_CODE: "PROJ1"
PROJECT_RULES: "+csharpsquid:S104;-ts:S1561"
PROJECT_RULES: "+csharpsquid:S104;-ts:S1561;+Web:WhiteSpaceAroundCheck"

db:
environment:
Expand Down
92 changes: 46 additions & 46 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,111 +53,111 @@
},
"rules": {
"cs": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+csharpsquid:S104 # NCSS; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)",
"+csharpsquid:S1067 # Too complex expression; NOT used by Quality-time",
"+csharpsquid:S107|max=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)",
"+csharpsquid:S109 # Magic numbers; NOT used by Quality-time",
"+csharpsquid:S1151 # Switch case clauses should not have too many lines of code. Used by Quality-time",
"+csharpsquid:S125 # Commented code; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#commented-out-code)",
"+csharpsquid:S1309 # Violation suppression; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+csharpsquid:S134 # Depth of nesting; NOT used by Quality-time",
"+csharpsquid:S1067 # Too complex expression; NOT used by Quality-time",
"+csharpsquid:S109 # Magic numbers; NOT used by Quality-time",
"+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"
"+csharpsquid:S1541|maximumFunctionComplexityThreshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)"
],
"java": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+java:S1541|Threshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+java:NoSonar # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+java:S1309 # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+java:S1310 # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+java:S1315 # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+java:S104 # Files should not have too many lines of code. Used by Quality-time",
"+java:S1067 # Expression too complex; NOT used by Quality-time",
"+java:S109 # Magic numbers; NOT used by Quality-time",
"+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:S109 # Magic numbers; NOT 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:S125 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#commented-out-code)",
"+java:S1309 # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+java:S1310 # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+java:S1315 # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+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:S1541|Threshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"+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"
],
"js": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+javascript:S1541|maximumFunctionComplexityThreshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"+javascript:S134 # NOT used by Quality-time",
"+javascript:S1067 # Expression too complex; NOT used by Quality-time",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+javascript:S104 # Files should not have too many lines of code. Used by Quality-time",
"+javascript:S106 # Console logging should not be used; NOT used by Quality-time",
"+javascript:S1067 # Expression too complex; NOT used by Quality-time",
"+javascript:S107|maximumFunctionParameters=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)",
"+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",
"+javascript:S134 # 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:S1541|maximumFunctionComplexityThreshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"# Missing: NoSonar, NCSS, Parameters"
],
"kotlin": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+kotlin:S104 # Files should not have too many lines of code. Used by Quality-time",
"+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:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)",
"+kotlin:S5612 # Lambdas should not have too many lines. Used by Quality-time"
],
"py": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+python:FunctionComplexity|maximumFunctionComplexityThreshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"+python:NoSonar # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+python:S104 # Too many lines of code in file; NOT used by Quality-time",
"+python:S107|max=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)",
"+python:NoSonar # Used by Quality-time to report on suppressed violations (https://quality-time.readthedocs.io/en/latest/reference.html#suppressed-violations)",
"+python:S125 # Commented code; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#commented-out-code)",
"+python:S134 # Too deep nesting; NOT used by Quality-time",
"+python:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)",
"+python:FunctionComplexity|maximumFunctionComplexityThreshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)"
"+python:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)"
],
"swift": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+swift:S1541|Threshold=10 # Used by Quality-time (https://github.com/ICTU/quality-time/blob/master/docs/METRICS_AND_SOURCES.md#complex-units-from-sonarqube)",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+swift:S104 # Files should not have too many lines of code. Used by Quality-time",
"+swift:S1067 # Expression too complex; NOT used by Quality-time",
"+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:S125 # Used by Quality-time (https://github.com/ICTU/quality-time/blob/master/docs/METRICS_AND_SOURCES.md#commented-out-code-from-sonarqube)",
"+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:S1541|Threshold=10 # Used by Quality-time (https://github.com/ICTU/quality-time/blob/master/docs/METRICS_AND_SOURCES.md#complex-units-from-sonarqube)",
"+swift:S2042 # Classes should not have too many lines of code. Used by Quality-time"
],
"ts": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+typescript:S109 # Magic number; NOT used by Quality-time",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+typescript:S104 # File length; NOT used by Quality-time",
"+typescript:S106 # Console logging; NOT used by Quality-time",
"+typescript:S107|maximumFunctionParameters=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)",
"+typescript:S1067 # Expression too complex; NOT used by Quality-time",
"+typescript:S1541|Threshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"+typescript:S107|maximumFunctionParameters=5 # Too many parameters; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#many-parameters)",
"+typescript:S109 # Magic number; NOT used by Quality-time",
"+typescript:S138|max=20 # Methods with too many lines; used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)",
"+typescript:S1541|Threshold=10 # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"+typescript:S4204 # The 'any' type should not be used; NOT used by Quality-time",
"-typescript:S4328 # reason: the rule does not recognize 'local' imports"
],
"vbnet": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+vbnet:S1541|maximumFunctionComplexityThreshold=10 # Too complex function, procedure or property; Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+vbnet:S104 # Files should not have too many lines of code. Used by Quality-time",
"+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",
"+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:S1541|maximumFunctionComplexityThreshold=10 # Too complex function, procedure or property; Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#complex-units)",
"# Missing: method length, NoSonar, too many parameters, commented loc"
],
"web": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+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)",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+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"
"+Web:ComplexityCheck # NOT used by Quality-time. Rule is deprecated, see https://rules.sonarsource.com/html/RSPEC-1908?search=complexity",
"+Web:FileLengthCheck # Files should not have too many lines. Used by Quality-time",
"+Web:LongJavaScriptCheck # Used by Quality-time (https://quality-time.readthedocs.io/en/latest/reference.html#long-units)"
],
"yaml": [
"+types=SECURITY_HOTSPOT,VULNERABILITY # Enable these types by default",
"+types=SECURITY_HOTSPOT,VULNERABILITY",
"+ansible:ANSIBLE0002",
"+ansible:ANSIBLE0004",
"+ansible:ANSIBLE0005",
Expand Down
Loading

0 comments on commit e4fdb86

Please sign in to comment.