File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ using Lambda;
1313@desc (" McCabe simplified cyclomatic complexity check" )
1414class CyclomaticComplexityCheck extends Check {
1515
16- public var thresholds : Array <Threshold >;
16+ public var thresholds : Array <Threshold > = [
17+ { severity : " WARNING" , complexity : 11 },
18+ { severity : " ERROR" , complexity : 21 }
19+ ];
1720
1821 override function _actualRun () {
1922 _checker .ast .decls .map (function (type : TypeDecl ): Null <Definition <ClassFlag , Array <Field >>> {
@@ -51,7 +54,7 @@ class CyclomaticComplexityCheck extends Check {
5154
5255 // This would not pass the cyclomatic complexity test.
5356 function evaluateExpr (e : Expr ): Int {
54- if (e == null ) {
57+ if (e == null || e . expr == null ) {
5558 return 0 ;
5659 }
5760 return switch (e .expr ) {
You can’t perform that action at this time.
0 commit comments