GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: init cyclo complexity to 1 · codebench-dev/api@ebcbb08

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/code-quality/complexity
    • CyclomaticComplexity.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/code-quality/complexity/CyclomaticComplexity.ts‎

Copy file name to clipboardExpand all lines: src/code-quality/complexity/CyclomaticComplexity.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { CodeTokens } from '../tokenizer/CodeTokens';
66
export class CyclomaticComplexity {
77
/**
88
* The cyclomatic complexity of a function is calculated according to the following rules:
9-
* -1 is the base complexity of a function
9+
* 1 is the base complexity of a function
1010
* +1 for each 'if', 'for', 'case', '&&' or '||'
1111
* @param tokenizedCode
1212
* @return cyclomaticComplexity
1313
*/
1414
public compute(tokenizedCode: CodeTokens[]): number {
15-
let cyclomaticComplexity = -1;
15+
let cyclomaticComplexity = 1;
1616

1717
tokenizedCode.forEach((token) => {
1818
// console.log(`token: ${token}`);

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.