Skip to content
This repository was archived by the owner on Jul 8, 2019. It is now read-only.

Commit 5167250

Browse files
committed
Update rules for tech debt, fix readme
1 parent 0d1eab7 commit 5167250

File tree

3 files changed

+115
-3
lines changed

3 files changed

+115
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ a configuration for that rule in SonarTsPlugin could look as follows:
108108
export-name.debtOffset=1h
109109
export-name.debtType=HARDWARE_RELATED_PORTABILITY
110110

111-
**You will need to restart the SonarQube server after configuring custom rules this way before subsequent analyses will pick them up.**
111+
**You will need to restart the SonarQube server after configuring custom rules this way before subsequent analyses will pick them up. You will also need to activate the new rules after restart for any quality profile you want them to participate in - by default they will be disabled.**
112112

113113
* for documentation about the `technical debt` parameters look [here](http://docs.sonarqube.org/display/PLUG/Rule+Remediation+Costs) and [here](http://javadocs.sonarsource.org/5.2/apidocs/org/sonar/api/server/debt/DebtRemediationFunction.html)
114114
* for possible values for `debtType` go [here](http://javadocs.sonarsource.org/5.2/apidocs/org/sonar/api/server/rule/RulesDefinition.SubCharacteristics.html)

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.pablissimo.sonar</groupId>
66
<artifactId>sonar-typescript-plugin</artifactId>
77
<packaging>sonar-plugin</packaging>
8-
<version>0.6-SNAPSHOT</version>
8+
<version>0.7-SNAPSHOT</version>
99

1010
<name>TypeScript</name>
1111
<description>Analyse TypeScript projects</description>
@@ -14,7 +14,7 @@
1414
<connection>scm:git:git@github.com:Pablissimo/SonarTsPlugin.git</connection>
1515
<developerConnection>scm:git:git@github.com:Pablissimo/SonarTsPlugin.git</developerConnection>
1616
<url>https://github.com/Pablissimo/SonarTsPlugin</url>
17-
<tag>0.6</tag>
17+
<tag>0.7</tag>
1818
</scm>
1919

2020
<properties>
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,223 +1,335 @@
11
align=true
22
align.name=enforces vertical alignment of parameters, arguments and statements
33
align.severity=MINOR
4+
align.debtFunc=CONSTANT_ISSUE
5+
align.debtScalar=5min
46

57
ban=true
68
ban.name=Use of this method is banned by current configuration
79
ban.severity=CRITICAL
10+
ban.debtFunc=CONSTANT_ISSUE
11+
ban.debtScalar=60min
812

913
class-name=true
1014
class-name.name=Name must use PascalCase
1115
class-name.severity=MAJOR
16+
class-name.debtFunc=CONSTANT_ISSUE
17+
class-name.debtScalar=5min
1218

1319
comment-format=true
1420
comment-format.name=Comments must be correctly formatted
1521
comment-format.severity=MINOR
22+
comment-format.debtFunc=CONSTANT_ISSUE
23+
comment-format.debtScalar=5min
1624

1725
curly=true
1826
curly.name=enforces braces for if/for/do/while statements
1927
curly.severity=MAJOR
28+
curly.debtFunc=CONSTANT_ISSUE
29+
curly.debtScalar=5min
2030

2131
eofline=true
2232
eofline.name=enforces the file to end with a newline
2333
eofline.severity=MINOR
34+
eofline.debtFunc=CONSTANT_ISSUE
35+
eofline.debtScalar=1min
2436

2537
forin=true
2638
forin.name=enforces a for ... in statement to be filtered with an if statement
2739
forin.severity=MAJOR
40+
forin.debtFunc=CONSTANT_ISSUE
41+
forin.debtScalar=5min
2842

2943
indent=true
3044
indent.name=enforces consistent indentation with tabs or spaces
3145
indent.severity=MINOR
46+
indent.debtFunc=CONSTANT_ISSUE
47+
indent.debtScalar=2min
3248

3349
interface-name=true
3450
interface-name.name=enforces the rule that interface names must begin with a capital I
3551
interface-name.severity=MAJOR
52+
interface-name.debtFunc=CONSTANT_ISSUE
53+
interface-name.debtScalar=1min
3654

3755
jsdoc-format=true
3856
jsdoc-format.name=enforces basic format rules for jsdoc comments - comments starting with /**
3957
jsdoc-format.severity=MAJOR
58+
jsdoc-format.debtFunc=CONSTANT_ISSUE
59+
jsdoc-format.debtScalar=3min
4060

4161
label-position=true
4262
label-position.name=enforces labels only on sensible statements
4363
label-position.severity=MAJOR
64+
label-position.debtFunc=CONSTANT_ISSUE
65+
label-position.debtScalar=20min
4466

4567
label-undefined=true
4668
label-undefined.name=checks that labels are defined before usage
4769
label-undefined.severity=CRITICAL
70+
label-undefined.debtFunc=CONSTANT_ISSUE
71+
label-undefined.debtScalar=5min
4872

4973
max-line-length=true
5074
max-line-length.name=sets the maximum length of a line
5175
max-line-length.severity=MAJOR
76+
label-undefined.debtFunc=CONSTANT_ISSUE
77+
label-undefined.debtScalar=1min
5278

5379
member-access=true
5480
member-access.name=enforces using explicit visibility on class members
5581
member-access.severity=MAJOR
82+
member-access.debtFunc=CONSTANT_ISSUE
83+
member-access.debtScalar=1min
5684

5785
member-ordering=true
5886
member-ordering.name=enforces ordering of class members
5987
member-ordering.severity=MAJOR
88+
member-ordering.debtFunc=CONSTANT_ISSUE
89+
member-ordering.debtScalar=5min
6090

6191
no-angle-bracket-type-assertion=true
6292
no-angle-bracket-type-assertion.name=enforces use of the 'as' operator for type assertions
6393
no-angle-bracket-type-assertion.severity=MAJOR
94+
no-angle-bracket-type-assertion.debtFunc=CONSTANT_ISSUE
95+
no-angle-bracket-type-assertion.debtScalar=5min
6496

6597
no-any=true
6698
no-any.name='any' must not be used as a type decoration
6799
no-any.severity=MAJOR
100+
no-any.debtFunc=CONSTANT_ISSUE
101+
no-any.debtScalar=20min
68102

69103
no-arg=true
70104
no-arg.name=arguments.callee must not be used
71105
no-arg.severity=MAJOR
106+
no-arg.debtFunc=CONSTANT_ISSUE
107+
no-arg.debtScalar=30min
72108

73109
no-bitwise=true
74110
no-bitwise.name=bitwise operators must not be used
75111
no-bitwise.severity=MAJOR
112+
no-bitwise.debtFunc=CONSTANT_ISSUE
113+
no-bitwise.debtScalar=5min
76114

77115
no-conditional-assignment=true
78116
no-conditional-assignment.name=disallows any type of assignment in conditionals - this applies to do-while, for, if and while statements
79117
no-conditional-assignment.severity=MAJOR
118+
no-conditional-assignment.debtFunc=CONSTANT_ISSUE
119+
no-conditional-assignment.debtScalar=5min
80120

81121
no-consecutive-blank-lines=true
82122
no-consecutive-blank-lines.name=No more than one blank line should appear in a row
83123
no-consecutive-blank-lines.severity=MINOR
124+
no-consecutive-blank-lines.debtFunc=CONSTANT_ISSUE
125+
no-consecutive-blank-lines.debtScalar=5min
84126

85127
no-console=true
86128
no-console.name=Specified function must not be called on the global console object
87129
no-console.severity=MAJOR
130+
no-console.debtFunc=CONSTANT_ISSUE
131+
no-console.debtScalar=5min
88132

89133
no-construct=true
90134
no-construct.name=Constructors of String, Number and Boolean must not be used
91135
no-construct.severity=MAJOR
136+
no-construct.debtFunc=CONSTANT_ISSUE
137+
no-construct.debtScalar=5min
92138

93139
no-constructor-vars=true
94140
no-constructor-vars.name=Public and private modifiers must not be used on constructor arguments
95141
no-constructor-vars.severity=MAJOR
142+
no-constructor-vars.debtFunc=CONSTANT_ISSUE
143+
no-constructor-vars.debtScalar=5min
96144

97145
no-debugger=true
98146
no-debugger.name=Debugger statements are not allowed
99147
no-debugger.severity=CRITICAL
148+
no-debugger.debtFunc=CONSTANT_ISSUE
149+
no-debugger.debtScalar=5min
100150

101151
no-duplicate-key=true
102152
no-duplicate-key.name=Duplicate keys must not be specified in object literals
103153
no-duplicate-key.severity=MAJOR
154+
no-duplicate-key.debtFunc=CONSTANT_ISSUE
155+
no-duplicate-key.debtScalar=5min
104156

105157
no-duplicate-variable=true
106158
no-duplicate-variable.name=Duplicate variable definitions are not allowed
107159
no-duplicate-variable.severity=MAJOR
160+
no-duplicate-variable.debtFunc=CONSTANT_ISSUE
161+
no-duplicate-variable.debtScalar=5min
108162

109163
no-empty=true
110164
no-empty.name=Empty blocks are not allowed
111165
no-empty.severity=MAJOR
166+
no-empty.debtFunc=CONSTANT_ISSUE
167+
no-empty.debtScalar=5min
112168

113169
no-eval=true
114170
no-eval.name=Use of eval is not allowed
115171
no-eval.severity=CRITICAL
172+
no-eval.debtFunc=CONSTANT_ISSUE
173+
no-eval.debtScalar=30min
116174

117175
no-inferrable-types=true
118176
no-inferrable-types.name=disallows explicit type declarations for variables or parameters initialised to a number, string or boolean
119177
no-inferrable-types.severity=MAJOR
178+
no-inferrable-types.debtFunc=CONSTANT_ISSUE
179+
no-inferrable-types.debtScalar=5min
120180

121181
no-internal-module=true
122182
no-internal-module.name=disallows internal modules - use namespaces instead
123183
no-internal-module.severity=MAJOR
184+
no-internal-module.debtFunc=CONSTANT_ISSUE
185+
no-internal-module.debtScalar=5min
124186

125187
no-null-keyword=true
126188
no-null-keyword.name=disallows use of the null keyword literal
127189
no-null-keyword.severity=MAJOR
190+
no-null-keyword.debtFunc=CONSTANT_ISSUE
191+
no-null-keyword.debtScalar=5min
128192

129193
no-require-imports=true
130194
no-require-imports.name=disallows invocation of require() - use ES6-style imports instead
131195
no-require-imports.severity=MAJOR
196+
no-require-imports.debtFunc=CONSTANT_ISSUE
197+
no-require-imports.debtScalar=5min
132198

133199
no-shadowed-variable=true
134200
no-shadowed-variable.name=disallows shadowed variable declarations
135201
no-shadowed-variable.severity=MAJOR
202+
no-shadowed-variable.debtFunc=CONSTANT_ISSUE
203+
no-shadowed-variable.debtScalar=10min
136204

137205
no-string-literal=true
138206
no-string-literal.name=Object access via string literals is not allowed
139207
no-string-literal.severity=MAJOR
208+
no-string-literal.debtFunc=CONSTANT_ISSUE
209+
no-string-literal.debtScalar=10min
140210

141211
no-switch-case-fall-through=true
142212
no-switch-case-fall-through.name=Falling through one case statement to another is not allowed
143213
no-switch-case-fall-through.severity=MAJOR
214+
no-switch-case-fall-through.debtFunc=CONSTANT_ISSUE
215+
no-switch-case-fall-through.debtScalar=5min
144216

145217
no-trailing-whitespace=true
146218
no-trailing-whitespace.name=Trailing whitespace at the end of lines is not allowed
147219
no-trailing-whitespace.severity=MINOR
220+
no-trailing-whitespace.debtFunc=CONSTANT_ISSUE
221+
no-trailing-whitespace.debtScalar=1min
148222

149223
no-unreachable=true
150224
no-unreachable.name=Unreachable code after break, catch, throw and return statements is not allowed
151225
no-unreachable.severity=MAJOR
226+
no-unreachable.debtFunc=CONSTANT_ISSUE
227+
no-unreachable.debtScalar=1min
152228

153229
no-unused-expression=true
154230
no-unused-expression.name=Unused expressions (those that aren't assignments or function calls) are not allowed
155231
no-unused-expression.severity=MAJOR
232+
no-unused-expression.debtFunc=CONSTANT_ISSUE
233+
no-unused-expression.debtScalar=1min
156234
157235
no-unused-variable=true
158236
no-unused-variable.name=Unused imports, variables, functions and private class members are not allowed
159237
no-unused-variable.severity=MAJOR
238+
no-unused-variable.debtFunc=CONSTANT_ISSUE
239+
no-unused-variable.debtScalar=1min
160240
161241
no-use-before-declare=true
162242
no-use-before-declare.name=Variable use before declaration is not allowed
163243
no-use-before-declare.severity=CRITICAL
244+
no-use-before-declare.debtFunc=CONSTANT_ISSUE
245+
no-use-before-declare.debtScalar=5min
164246
165247
no-var-keyword=true
166248
no-var-keyword.name=disallows usage of the var keyword - use let or const instead
167249
no-var-keyword.severity=MAJOR
250+
no-var-keyword.debtFunc=CONSTANT_ISSUE
251+
no-var-keyword.debtScalar=1min
168252
169253
no-var-requires=true
170254
no-var-requires.name=Require is only allowed in import statements
171255
no-var-requires.severity=MAJOR
256+
no-var-requires.debtFunc=CONSTANT_ISSUE
257+
no-var-requires.debtScalar=5min
172258
173259
object-literal-sort-keys=true
174260
object-literal-sort-keys.name=checks that keys in object literals are declared in alphabetical order (useful to prevent merge conflicts)
175261
object-literal-sort-keys.severity=MINOR
262+
object-literal-sort-keys.debtFunc=CONSTANT_ISSUE
263+
object-literal-sort-keys.debtScalar=5min
176264
177265
one-line=true
178266
one-line.name=No newline is allowed before keyword
179267
one-line.severity=MINOR
268+
one-line.debtFunc=CONSTANT_ISSUE
269+
one-line.debtScalar=1min
180270
181271
quotemark=true
182272
quotemark.name=Consistent use of single or double quotes is required - a mixture is not allowed
183273
quotemark.severity=MAJOR
274+
quotemark.debtFunc=CONSTANT_ISSUE
275+
quotemark.debtScalar=1min
184276
185277
radix=true
186278
radix.name=A radix must be specified when calling parseInt
187279
radix.severity=CRITICAL
280+
radix.debtFunc=CONSTANT_ISSUE
281+
radix.debtScalar=1min
188282
189283
semicolon=true
190284
semicolon.name=Statement must end with a semicolon
191285
semicolon.severity=MAJOR
286+
semicolon.debtFunc=CONSTANT_ISSUE
287+
semicolon.debtScalar=1min
192288
193289
switch-default=true
194290
switch-default.name=enforces a default case in switch statements
195291
switch-default.severity=MAJOR
292+
switch-default.debtFunc=CONSTANT_ISSUE
293+
switch-default.debtScalar=5min
196294
197295
trailing-comma=true
198296
trailing-comma.name=enforces a standard for trailing commas within array and object literals, destructuring assignment and named imports
199297
trailing-comma.severity=MINOR
298+
trailing-comma.debtFunc=CONSTANT_ISSUE
299+
trailing-comma.debtScalar=1min
200300
201301
triple-equals=true
202302
triple-equals.name=== and != must not be used - use === or !== instead
203303
triple-equals.severity=MAJOR
304+
triple-equals.debtFunc=CONSTANT_ISSUE
305+
triple-equals.debtScalar=5min
204306
205307
typedef=true
206308
typedef.name=Type definition must be specified
207309
typedef.severity=MAJOR
310+
typedef.debtFunc=CONSTANT_ISSUE
311+
typedef.debtScalar=5min
208312
209313
typedef-whitespace=true
210314
typedef-whitespace.name=Whitespace around type definitions must be correct
211315
typedef-whitespace.severity=MINOR
316+
typedef-whitespace.debtFunc=CONSTANT_ISSUE
317+
typedef-whitespace.debtScalar=5min
212318
213319
use-strict=true
214320
use-strict.name=Strict mode must be used
215321
use-strict.severity=CRITICAL
322+
use-strict.debtFunc=CONSTANT_ISSUE
323+
use-strict.debtScalar=5min
216324
217325
variable-name=true
218326
variable-name.name=Variable names must be either camelCased or UPPER_CASED
219327
variable-name.severity=MAJOR
328+
variable-name.debtFunc=CONSTANT_ISSUE
329+
variable-name.debtScalar=5min
220330
221331
whitespace=true
222332
whitespace.name=Inappropriate whitespace between tokens
223333
whitespace.severity=MINOR
334+
whitespace.debtFunc=CONSTANT_ISSUE
335+
whitespace.debtScalar=5min

0 commit comments

Comments
 (0)