heilhead/es-identifier-highlight

View on GitHub

Showing 27 of 56 total issues

File walk.js has 357 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use babel';

// AST walker module for Mozilla Parser API compatible trees

// A simple walk is one where you simply specify callbacks to be
Severity: Minor
Found in lib/inspector/walk.js - About 4 hrs to fix

    Function _inspect has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _inspect() {
            let scopeId = 0;
            let scope = new Scope(scopeId, this._ast);
    
            let scopes = this._scopes = [];
    Severity: Major
    Found in lib/inspector/inspector.js - About 3 hrs to fix

      File view.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use babel';
      
      import { CompositeDisposable, Range } from 'atom';
      import Inspector from './inspector/inspector.js';
      import RenameDialog from './rename-dialog.js';
      Severity: Minor
      Found in lib/view.js - About 2 hrs to fix

        Function _getLiteralUsages has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _getLiteralUsages(text) {
                let result = [];
        
                // ignore empty string literals
                if (typeof text === 'string' && !text.trim()) {
        Severity: Major
        Found in lib/inspector/handlers/literal.js - About 2 hrs to fix

          Function findNodeAt has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          export function findNodeAt(node, start, end, test, base, state) {
            test = makeTest(test);
            if (!base) base = exports.base;
            try {
              (function c(node, st, override) {
          Severity: Minor
          Found in lib/inspector/walk.js - 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 _getLiteralUsages has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              _getLiteralUsages(text) {
                  let result = [];
          
                  // ignore empty string literals
                  if (typeof text === 'string' && !text.trim()) {
          Severity: Minor
          Found in lib/inspector/handlers/literal.js - 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 _inspect has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              _inspect() {
                  let scopeId = 0;
                  let scope = new Scope(scopeId, this._ast);
          
                  let scopes = this._scopes = [];
          Severity: Minor
          Found in lib/inspector/inspector.js - 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 constructor has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constructor() {
                  this._subscriptions = new CompositeDisposable();
                  this._editorSubscriptions = new CompositeDisposable();
          
                  this._subscriptions.add(
          Severity: Minor
          Found in lib/view.js - About 1 hr to fix

            Function _highlightOccurrences has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _highlightOccurrences() {
                    if (this._skipNextParse) {
                        this._skipNextParse = false;
            
                        return;
            Severity: Minor
            Found in lib/view.js - About 1 hr to fix

              Function _getGlobalVarUsages has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _getGlobalVarUsages(node) {
                      let result = [];
                      let name = node.name;
              
                      recursive(this.getProgramNode(), {}, {
              Severity: Minor
              Found in lib/inspector/handlers/variable.js - About 1 hr to fix

                Function _getVarUsages has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _getVarUsages(def) {
                        let result = [];
                
                        recursive(def.scope.getNode(), {}, {
                            VariablePattern: skipThrough,
                Severity: Minor
                Found in lib/inspector/handlers/variable.js - About 1 hr to fix

                  Function _refactor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _refactor(newName) {
                          let occ = this._occurences,
                              oldName = occ.definition.name;
                  
                          if (newName === oldName) {
                  Severity: Minor
                  Found in lib/view.js - About 1 hr to fix

                    Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        constructor(inspector) {
                            super(inspector);
                    
                            inspector.registerHandler([
                                'Literal',
                    Severity: Minor
                    Found in lib/inspector/handlers/literal.js - About 1 hr to fix

                      Function findNodeBefore has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function findNodeBefore(node, pos, test, base, state) {
                        test = makeTest(test);
                        if (!base) base = exports.base;
                        let max;
                        (function c(node, st, override) {
                      Severity: Minor
                      Found in lib/inspector/walk.js - About 55 mins 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 findNodeAfter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function findNodeAfter(node, pos, test, base, state) {
                        test = makeTest(test);
                        if (!base) base = exports.base;
                        try {
                          (function c(node, st, override) {
                      Severity: Minor
                      Found in lib/inspector/walk.js - About 55 mins 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 findNodeAround has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function findNodeAround(node, pos, test, base, state) {
                        test = makeTest(test);
                        if (!base) base = exports.base;
                        try {
                          (function c(node, st, override) {
                      Severity: Minor
                      Found in lib/inspector/walk.js - About 55 mins 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 _findVarDefinition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          _findVarDefinition(node) {
                              let params = utils.getInspectorData(node);
                      
                              if (!params) {
                                  return false;
                      Severity: Minor
                      Found in lib/inspector/handlers/variable.js - About 45 mins 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 _getGlobalVarUsages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          _getGlobalVarUsages(node) {
                              let result = [];
                              let name = node.name;
                      
                              recursive(this.getProgramNode(), {}, {
                      Severity: Minor
                      Found in lib/inspector/handlers/variable.js - About 45 mins 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 ancestor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function ancestor(node, visitors, base, state) {
                        if (!base) base = exports.base;
                        let ancestors = [];
                        (function c(node, st, override) {
                          let type = override || node.type, found = visitors[type];
                      Severity: Minor
                      Found in lib/inspector/walk.js - About 45 mins 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 findNodeAt has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      export function findNodeAt(node, start, end, test, base, state) {
                      Severity: Minor
                      Found in lib/inspector/walk.js - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language