Geek-Research-Lab/MeowJS

View on GitHub
MeowEventProxy.js

Summary

Maintainability
F
3 days
Test Coverage

Function MeowEventProxy has 312 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var MeowEventProxy = function() {
    'use strict';
    var define, proxy;
    var xxx = this;

Severity: Major
Found in MeowEventProxy.js - About 1 day to fix

    File MeowEventProxy.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // MeowEventProxy => Implementation of task-based asynchronous pattern
    var MeowEventProxy = function() {
        'use strict';
        var define, proxy;
        var xxx = this;
    Severity: Minor
    Found in MeowEventProxy.js - About 3 hrs to fix

      Function assign has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              var assign = function() {
                  var Meow_ArgsLen = arguments.length;
                  var times = 0;
                  var Meow_Flag = {};
                  // Checking arguments length
      Severity: Minor
      Found in MeowEventProxy.js - About 1 hr to fix

        Function after has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                   MeowEventProxyy.prototype.after = function(eventName, meowCallback, times) {
                       if(times === 0) {
                           meowCallback.call(null, []);
                           return xxx;
                       }
        Severity: Minor
        Found in MeowEventProxy.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                                      if(meowCallback === list[m]) {
                                          debug('Remove a Listener of %s', eventName);
                                          list[m] = null;
                                      }
          Severity: Major
          Found in MeowEventProxy.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        for(var m2 = begin; m2 < arguments.length; m2++) {
                                            Meow_Args.push(arguments[m2]);
                                        }
            Severity: Major
            Found in MeowEventProxy.js - About 45 mins to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      MeowEventProxyy.prototype.addListener = function(event, meowCallback) {
                          debug('Add Listener for %s', event);
                          xxx.meowCallback[event] = xxx.meowCallback[event] || [];
                          xxx.meowCallback[event].push(meowCallback);
                          return xxx;
              Severity: Major
              Found in MeowEventProxy.js and 1 other location - About 2 hrs to fix
              MeowEventProxy.js on lines 57..62

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 79.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      MeowEventProxyy.prototype.headbind = function(event, meowCallback) {
                          debug('Add Listener for %s', event);
                          xxx.meowCallback[event] = xxx.meowCallback[event] || [];
                          xxx.meowCallback[event].unshift(meowCallback);
                          return xxx;
              Severity: Major
              Found in MeowEventProxy.js and 1 other location - About 2 hrs to fix
              MeowEventProxy.js on lines 48..53

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 79.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                         MeowEventProxyy.prototype.tail = function() {
                             var Meow_Args = MeowConcat.apply([], arguments);
                             Meow_Args.push(false);
                             assign.apply(xxx, Meow_Args);
                             return xxx;
              Severity: Major
              Found in MeowEventProxy.js and 1 other location - About 1 hr to fix
              MeowEventProxy.js on lines 218..223

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 62.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      MeowEventProxyy.prototype.all = function() {
                          var Meow_Args = MeowConcat.apply([], arguments);
                          Meow_Args.push(true);
                          assign.apply(xxx, Meow_Args);
                          return xxx;
              Severity: Major
              Found in MeowEventProxy.js and 1 other location - About 1 hr to fix
              MeowEventProxy.js on lines 238..243

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 62.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status