DevOpsPlayground/directory-react-nodejs

View on GitHub

Showing 11 of 25 total issues

File ratchet.js has 681 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * =====================================================
 * Ratchet v2.0.2 (http://goratchet.com)
 * Copyright 2014 Connor Sears
 * Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
Severity: Major
Found in www/ratchet/js/ratchet.js - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

        if (!target ||
            e.which > 1 ||
            e.metaKey ||
            e.ctrlKey ||
            isScrolling ||
    Severity: Critical
    Found in www/ratchet/js/ratchet.js - About 2 hrs to fix

      Function router has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      var router = (function () {
      
          "use strict";
      
          var routes = [];
      Severity: Minor
      Found in www/js/router.js - About 2 hrs 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 swapContent has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var swapContent = function (swap, container, transition, complete) {
          var enter;
          var containerDirection;
          var swapDirection;
      
      
      Severity: Major
      Found in www/ratchet/js/ratchet.js - About 2 hrs to fix

        Function popstate has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var popstate = function (e) {
            var key;
            var barElement;
            var activeObj;
            var activeDom;
        Severity: Major
        Found in www/ratchet/js/ratchet.js - About 2 hrs to fix

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

              render: function () {
                  return (
                      <div className={"page " + this.props.position}>
                          <Header text="Employee" back="true"/>
                          <div className="card">
          Severity: Minor
          Found in www/js/app.js - About 2 hrs to fix

            Function PUSH has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var PUSH = function (options) {
                var key;
                var xhr = PUSH.xhr;
            
                options.container = options.container || options.transition ? document.querySelector('.content') : document.body;
            Severity: Minor
            Found in www/ratchet/js/ratchet.js - About 1 hr to fix

              Function success has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                var success = function (xhr, options) {
                  var key;
                  var barElement;
                  var data = parseXHR(xhr, options);
              
              
              Severity: Minor
              Found in www/ratchet/js/ratchet.js - About 1 hr to fix

                Function router has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var router = (function () {
                
                    "use strict";
                
                    var routes = [];
                Severity: Minor
                Found in www/js/router.js - About 1 hr to fix

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

                    var parseXHR = function (xhr, options) {
                      var head;
                      var body;
                      var data = {};
                      var responseText = xhr.responseText;
                  Severity: Minor
                  Found in www/ratchet/js/ratchet.js - About 1 hr to fix

                    Avoid too many return statements within this function.
                    Open

                          return (handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)');
                    Severity: Major
                    Found in www/ratchet/js/ratchet.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language