conveyal/modeify

View on GitHub

Showing 301 of 580 total issues

Avoid too many return statements within this function.
Open

  if ('object' == typeof key) return each(key, set);
Severity: Major
Found in client/components/yields/store/master/index.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return ms + 'ms';
    Severity: Major
    Found in client/components/rauchg/ms.js/0.7.0/index.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          if (!hashbang && el.pathname === location.pathname && (el.hash || '#' === link)) return;
      Severity: Major
      Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}
        Severity: Major
        Found in client/components/visionmedia/superagent/v1.1.0/lib/client.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return {
                  x: this.labelAnchor.x - bboxSide,
                  y: this.labelAnchor.y,
                  width: bboxSide,
                  height: bboxSide

            Avoid too many return statements within this function.
            Open

                  return {
                    x: this.labelAnchor.x - bboxSide,
                    y: this.labelAnchor.y - bboxSide,
                    width: bboxSide,
                    height: bboxSide

              Avoid too many return statements within this function.
              Open

                  if (!sameOrigin(el.href)) return;
              Severity: Major
              Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return false;
                Severity: Major
                Found in client/components/visionmedia/superagent/v1.1.0/lib/client.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      if (base && orig === path) return;
                  Severity: Major
                  Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return {
                            x: this.labelAnchor.x,
                            y: this.labelAnchor.y,
                            width: bboxSide,
                            height: bboxSide

                      Avoid too many return statements within this function.
                      Open

                          return true
                      Severity: Major
                      Found in lib/plan/profile-filter.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return {
                                x: this.labelAnchor.x,
                                y: this.labelAnchor.y - bboxSide,
                                width: bboxSide,
                                height: bboxSide

                          Avoid too many return statements within this function.
                          Open

                              if (link && link.indexOf('mailto:') > -1) return;
                          Severity: Major
                          Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return '#333'
                            Severity: Major
                            Found in client/convert/index.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  if (el.getAttribute('download') || el.getAttribute('rel') === 'external') return;
                              Severity: Major
                              Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    if (el.target) return;
                                Severity: Major
                                Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return true
                                  Severity: Major
                                  Found in lib/plan/profile-filter.js - About 30 mins to fix

                                    Function store has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function store(key, value){
                                      var length = arguments.length;
                                      if (0 == length) return all();
                                      if (2 <= length) return set(key, value);
                                      if (1 != length) return;
                                    Severity: Minor
                                    Found in client/components/yields/store/master/index.js - About 25 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 mergeEdges has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    NetworkGraph.prototype.mergeEdges = function(edge1, edge2) {
                                    
                                      // reverse edges if necessary
                                      if (edge1.fromVertex === edge2.toVertex) {
                                        this.mergeEdges(edge2, edge1);
                                    Severity: Minor
                                    Found in client/components/conveyal/transitive.js/master/lib/graph/index.js - About 25 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 loadCommuter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function loadCommuter (next) {
                                      var commuterData = store('commuter')
                                      var user = session.user()
                                    
                                      if (session.commuter()) {
                                    Severity: Minor
                                    Found in client/session/index.js - About 25 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language