NateFerrero/amna

View on GitHub

Showing 63 of 93 total issues

File angular-animate.js has 1106 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license AngularJS v1.3.15
 * (c) 2010-2014 Google, Inc. http://angularjs.org
 * License: MIT
 */
Severity: Major
Found in examples/uploader/public/js/angular-animate.js - About 2 days to fix

    Function exports has 258 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (amna) {
    
        amna.mongoId = function (param) {
            return ':' + param + '([0-9a-f]{24})';
        };
    Severity: Major
    Found in src/lib/collection.js - About 1 day to fix

      Function exports has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function (amna) {
      
          amna.mongoId = function (param) {
              return ':' + param + '([0-9a-f]{24})';
          };
      Severity: Minor
      Found in src/lib/collection.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 performAnimation has 171 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
              var noopCancel = noop;
              var runner = animationRunner(element, animationEvent, className, options);
              if (!runner) {
                fireDOMOperation();
      Severity: Major
      Found in examples/uploader/public/js/angular-animate.js - About 6 hrs to fix

        Function animationRunner has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function animationRunner(element, animationEvent, className, options) {
                //transcluded directives may sometimes fire an animation using only comment nodes
                //best to catch this early on to prevent any animation operations from occurring
                var node = element[0];
                if (!node) {
        Severity: Major
        Found in examples/uploader/public/js/angular-animate.js - About 5 hrs to fix

          Function phase_1 has 139 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function phase_1(amna, log) {
          
              var AMNACache = amna.thing.mongoose({
                  key: {
                      type: String,
          Severity: Major
          Found in src/lib/cache.js - About 5 hrs to fix

            Function exports has 131 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (amna) {
            
                var MongooseThing = function MongooseThing(schema) {
                    schema.deleted = Boolean;
                    if (amna.createdByThing) {
            Severity: Major
            Found in src/lib/thing-mongoose.js - About 5 hrs to fix

              Function exports has 126 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function (amna, log) {
              
                  var queryJSON = function (data) {
                      return '?' + encodeURIComponent(JSON.stringify(data));
                  };
              Severity: Major
              Found in src/lib/authentication.js - About 5 hrs to fix

                Function animateRun has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {
                        var node = extractElementNode(element);
                        var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);
                        if (node.getAttribute('class').indexOf(className) == -1 || !elementData) {
                          activeAnimationComplete();
                Severity: Major
                Found in examples/uploader/public/js/angular-animate.js - About 4 hrs to fix

                  Function exports has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports = function (amna, log) {
                  
                      var queryJSON = function (data) {
                          return '?' + encodeURIComponent(JSON.stringify(data));
                      };
                  Severity: Minor
                  Found in src/lib/authentication.js - About 4 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 exports has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports = function (amna) {
                  
                      var MongooseThing = function MongooseThing(schema) {
                          schema.deleted = Boolean;
                          if (amna.createdByThing) {
                  Severity: Minor
                  Found in src/lib/thing-mongoose.js - About 4 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 link has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        link: function (scope, element, attrs) {
                          // Give each directive instance a new id
                          iframeID++;
                  
                          function setLoadingState(state) {
                  Severity: Major
                  Found in examples/uploader/public/js/ng-upload.js - About 4 hrs to fix

                    Function exports has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function (amna, log) {
                    
                        var Interaction = function (req, res, next, done) {
                            this.req = req;
                            this.res = res;
                    Severity: Major
                    Found in src/lib/interaction.js - About 3 hrs to fix

                      Function $auth has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          amna.$auth = function (done) {
                              defaults();
                              setupAuth();
                      
                              amna.$passport = passport;
                      Severity: Major
                      Found in src/lib/authentication.js - About 3 hrs to fix

                        Function exports has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function (amna, log) {
                            return function (config, done) {
                        
                                /**
                                 * Set settings
                        Severity: Major
                        Found in src/lib/start.js - About 2 hrs to fix

                          Function exports has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                          module.exports = function (amna, log) {
                          
                              var Interaction = function (req, res, next, done) {
                                  this.req = req;
                                  this.res = res;
                          Severity: Minor
                          Found in src/lib/interaction.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 exports has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function (amna, log) {
                              var app = express();
                              app.use(bodyParser.urlencoded({ extended: true }));
                              app.use(bodyParser.json());
                              app.use(methodOverride('_method'));
                          Severity: Major
                          Found in src/lib/$express.js - About 2 hrs to fix

                            File collection.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            'use strict';
                            
                            /**
                             * AMNA: Amazing Mongoose Node.js API
                             *
                            Severity: Minor
                            Found in src/lib/collection.js - About 2 hrs to fix

                              Function setClass has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      setClass: function(element, add, remove, options) {
                                        options = parseAnimateOptions(options);
                              
                                        var STORAGE_KEY = '$$animateClasses';
                                        element = angular.element(element);
                              Severity: Major
                              Found in examples/uploader/public/js/angular-animate.js - About 2 hrs to fix

                                Function exports has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                Open

                                module.exports = function () {
                                
                                    var Stack = function Stack() {
                                        this.stack = [];
                                    };
                                Severity: Minor
                                Found in src/lib/stack.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

                                Severity
                                Category
                                Status
                                Source
                                Language