Hirse/brackets-outline-list

View on GitHub
src/lexers/JSParser.js

Summary

Maintainability
D
1 day
Test Coverage
A
96%

Function JSParser has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

define(function JSParser(require, exports, module) {
    "use strict";

    var espree = require("thirdparty/espree");

Severity: Minor
Found in src/lexers/JSParser.js - About 1 day 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 JSParser has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

define(function JSParser(require, exports, module) {
    "use strict";

    var espree = require("thirdparty/espree");

Severity: Major
Found in src/lexers/JSParser.js - About 4 hrs to fix

    Function _visit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _visit(node, name, level) {
            if (node.type === "ClassDeclaration") {
                return {
                    name: node.id.name,
                    line: node.loc.start.line,
    Severity: Minor
    Found in src/lexers/JSParser.js - About 2 hrs to fix

      Avoid too many return statements within this function.
      Open

                      return false;
      Severity: Major
      Found in src/lexers/JSParser.js - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status