indigotech/dangerjs-plugin

View on GitHub

Showing 4 of 77 total issues

File node.test.ts has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as Faker from 'faker';
import { filesToCheck, node } from './node';

declare const global: any;

Severity: Minor
Found in src/rules/node.test.ts - About 2 hrs to fix

    File platform-agnostic.test.ts has 268 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import * as Faker from 'faker';
    import { filesToCheck, platformAgnostic } from './platform-agnostic';
    
    declare const global: any;
    
    
    Severity: Minor
    Found in src/rules/platform-agnostic.test.ts - About 2 hrs to fix

      Function nodeVersion has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        async nodeVersion() {
      
          const files = ([] as string[]).concat(
            danger.git.created_files  || [],
            danger.git.modified_files || [],
      Severity: Minor
      Found in src/rules/node.ts - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function nodeVersion has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async nodeVersion() {
      
          const files = ([] as string[]).concat(
            danger.git.created_files  || [],
            danger.git.modified_files || [],
      Severity: Minor
      Found in src/rules/node.ts - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language