File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -10,3 +10,4 @@ This file contains all the rules for the supported languages.
10
10
## Python
11
11
* If the function names are not in snake case, decrease score of 3 points
12
12
* If the function names is longer than 25 characters, decrease score of 1 points
13
+ * If the line in a function have more than 80 characters, decrease score of 1 point
Original file line number Diff line number Diff line change @@ -19,15 +19,19 @@ export class PythonVisitor {
19
19
if ( line . startsWith ( 'def' ) ) {
20
20
const funcNameRaw = line . substring ( 3 ) ;
21
21
const funcName = funcNameRaw . split ( '(' ) [ 0 ] ;
22
- console . log ( funcName ) ;
23
22
// If function name is not written is snake case => quality -3
24
23
if ( ! CommonQualityFunction . isSnakeCase ( funcName ) ) {
25
24
this . codeQuality . score -= 3 ;
26
25
}
26
+ // If function name name is greater than 25 character => quality -1
27
27
if ( funcName . length > 25 ) {
28
28
this . codeQuality . score -= 1 ;
29
29
}
30
30
}
31
+ // If there more than 80 characters in the line => quality -1
32
+ if ( line . length > 80 ) {
33
+ this . codeQuality . score -= 1 ;
34
+ }
31
35
} ) ;
32
36
} ,
33
37
} ) . visit ( astTree ) ;
You can’t perform that action at this time.
0 commit comments