NateFerrero/amna

View on GitHub

Showing 63 of 93 total issues

Function collectionPost has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            collection.routes.collectionPost = collection.collectionPost('', function (self) {
                var Model = collection.thing.model;

                var filter = function (data) {
                    /**
Severity: Minor
Found in src/lib/collection.js - About 1 hr to fix

    Function registerModules has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        return function registerModules(path, modules) {
    
            if (typeof path !== 'string') {
                modules = path;
                path = '';
    Severity: Minor
    Found in src/lib/registerModules.js - About 1 hr to fix

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

            function resolveElementClasses(element, cache, runningAnimations) {
              runningAnimations = runningAnimations || {};
      
              var lookup = {};
              forEach(runningAnimations, function(data, selector) {
      Severity: Minor
      Found in examples/uploader/public/js/angular-animate.js - About 1 hr to fix

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

                function closeAnimation() {
                  if (!closeAnimation.hasBeenRun) {
                    if (runner) { //the runner doesn't exist if it fails to instantiate
                      runner.applyStyles();
                    }
        Severity: Minor
        Found in examples/uploader/public/js/angular-animate.js - About 1 hr to fix

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

          log.error = function () {
              var args = Array.prototype.slice.apply(arguments).map(function (x) {
                  return x && x.$repr ? x.$repr : x.toString();
              });
              args.unshift('    AMNA ' + (new Date()).toString() + '\n==>');
          Severity: Minor
          Found in src/index.js - About 1 hr to fix

            Function performAnimation has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
            Severity: Major
            Found in examples/uploader/public/js/angular-animate.js - About 1 hr to fix

              Function error has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              log.error = function () {
                  var args = Array.prototype.slice.apply(arguments).map(function (x) {
                      return x && x.$repr ? x.$repr : x.toString();
                  });
                  args.unshift('    AMNA ' + (new Date()).toString() + '\n==>');
              Severity: Minor
              Found in src/index.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 animate has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      animate: function(element, className, from, to, animationCompleted, options) {
              Severity: Minor
              Found in examples/uploader/public/js/angular-animate.js - About 45 mins to fix

                Function animateAfter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      function animateAfter(animationEvent, element, className, afterAnimationComplete, styles) {
                Severity: Minor
                Found in examples/uploader/public/js/angular-animate.js - About 35 mins to fix

                  Function animate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        function animate(animationEvent, element, className, animationComplete, options) {
                  Severity: Minor
                  Found in examples/uploader/public/js/angular-animate.js - About 35 mins to fix

                    Function animateRun has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {
                    Severity: Minor
                    Found in examples/uploader/public/js/angular-animate.js - About 35 mins to fix

                      Function beforeSetClass has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              beforeSetClass: function(element, add, remove, animationCompleted, options) {
                      Severity: Minor
                      Found in examples/uploader/public/js/angular-animate.js - About 35 mins to fix

                        Function animate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                animate: function(element, from, to, className, options) {
                        Severity: Minor
                        Found in examples/uploader/public/js/angular-animate.js - About 35 mins to fix

                          Function setClass has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  setClass: function(element, add, remove, animationCompleted, options) {
                          Severity: Minor
                          Found in examples/uploader/public/js/angular-animate.js - About 35 mins to fix

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

                            module.exports = function (amna, passport) {
                                if (typeof amna.authentication.facebook !== 'function') {
                                    throw new Error('amna.authentication.facebook must be: function  (profile, tokens, done)');
                                }
                            
                            
                            Severity: Minor
                            Found in src/lib/authentication-facebook.js - About 35 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 log has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            var log = function () {
                                var args = Array.prototype.slice.apply(arguments).map(function (x) {
                                    return x && x.$repr ? x.$repr : x;
                                });
                                if (logCapture.length) {
                            Severity: Minor
                            Found in src/index.js - About 35 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 exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            module.exports = function (amna, passport) {
                                if (typeof amna.authentication.google !== 'function') {
                                    throw new Error('amna.authentication.google must be: function (profile, tokens, done)');
                                }
                            
                            
                            Severity: Minor
                            Found in src/lib/authentication-google.js - About 35 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

                            Avoid too many return statements within this function.
                            Open

                                        return schema.map(MongooseThing.encodeJsonSchema);
                            Severity: Major
                            Found in src/lib/thing-mongoose.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return json;
                              Severity: Major
                              Found in src/lib/thing-mongoose.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return {type: 'date'};
                                Severity: Major
                                Found in src/lib/thing-mongoose.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language