Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
fix(member-ordering): check getter and setter methods (#3984)
Browse files Browse the repository at this point in the history
  • Loading branch information
NaridaL authored and adidahiya committed Oct 5, 2019
1 parent 8356b58 commit df68ccf
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 74 deletions.
14 changes: 7 additions & 7 deletions src/rules/cyclomaticComplexityRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ export class Rule extends Lint.Rules.AbstractRule {
);
}

private get threshold(): number {
if (this.ruleArguments[0] !== undefined) {
return this.ruleArguments[0] as number;
}
return Rule.DEFAULT_THRESHOLD;
}

public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithFunction(sourceFile, walk, { threshold: this.threshold });
}
Expand All @@ -76,13 +83,6 @@ export class Rule extends Lint.Rules.AbstractRule {
typeof this.threshold === "number" && this.threshold >= Rule.MINIMUM_THRESHOLD;
return super.isEnabled() && isThresholdValid;
}

private get threshold(): number {
if (this.ruleArguments[0] !== undefined) {
return this.ruleArguments[0] as number;
}
return Rule.DEFAULT_THRESHOLD;
}
}

function walk(ctx: Lint.WalkContext<{ threshold: number }>): void {
Expand Down
Loading

0 comments on commit df68ccf

Please sign in to comment.