Geek-Research-Lab/MeowJS

View on GitHub

Showing 116 of 116 total issues

Function Meow_ForEach has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

var Meow_ForEach = function() {
    'use strict';
    var build = this;
    if(!Array.Meow_forEach) {
        Array.Meow_forEach = function(Meow_Array, Meow_Block, Meow_Context) {
Severity: Minor
Found in Meow_forEach.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 Meow_Path has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Meow_Path = function() {
    "use strict";
    var Meow_isWin = Meow_Process.platform === 'win32';
    var Meow_PathSplit;
    Meow_Path.meowArrayNormalize = function(Meow_Parts, Meow_AllowAbvRoot) {
Severity: Major
Found in Meow_Path.js - About 2 hrs to fix

    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.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

    Function Meow_Semantics has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Meow_Semantics = function() {
        "use strict";
        // Main Semantics
        var window, document;
    // 1. Text Semantics
    Severity: Major
    Found in Meow_Semantics.js - About 2 hrs to fix

      Function util has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

      function util() {
          return {
              formatSize: function(spareSize) {
                  if(spareSize === 0) {
                      return "0B";
      Severity: Minor
      Found in NotAdded/video/util.js - About 1 hr 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 ensureConnection has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              ensureConnection: function(peerID, connect) {
                  if(ig.peers[peerID]) {
                      return ig.peers[peerID];
                  } else {
                      var p;
      Severity: Minor
      Found in NotAdded/video/p2p.js - About 1 hr 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 Meow_Extend has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Meow_Extend: function(Meow_Src, Meow_Val) {
                  if(Meow_Args.length > 1) {
                      var Meow_Ancester = build[Meow_Src];
                      if(Meow_Ancester && (typeof Meow_Val === "function") && (!Meow_Ancester.valueOf || Meow_Ancester.valueOf() !== Meow_Val.valueOf()) && /\bbase\b/.test(Meow_Val)) {
                          var Meow_Method = Meow_Val.valueOf();
          Severity: Minor
          Found in Meow_Base.js - About 1 hr to fix

            Function Meow_HTTP has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var Meow_HTTP = function() {
              "use strict";
              var Meow_CacheCtrl;
                Meow_HTTP.Meow_CacheCtrl = function() {
                  Meow_CacheCtrl.Meow_CachingCtrl = function(Meow_Req, Meow_Response, meowNextMarker) {
            Severity: Minor
            Found in Meow_HTTP.js - About 1 hr to fix

              Function xCalculateHash has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      xCalculateHash: function(builder) {
                          var m;
                          var window;
                          var workers = [];
                          var file = builder.file;
              Severity: Minor
              Found in NotAdded/video/meta.js - About 1 hr to fix

                Function parse has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var parse = function(Meow_Decoder, Meow_HelloBuffer, Meow_Offset, Meow_Defn, Meow_MsgName) {
                            var meowDecodeKey;
                            var Meow_ParsedKey = meowDecodeKey(Meow_HelloBuffer, Meow_Offset);
                            Meow_Offset = Meow_ParsedKey.Meow_Offset;
                            var Meow_Parsers = Meow_BufferTypes[Meow_ParsedKey.type].Meow_Parsers;
                Severity: Minor
                Found in Meow_Buffer.js - About 1 hr to fix

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

                  function util() {
                      return {
                          formatSize: function(spareSize) {
                              if(spareSize === 0) {
                                  return "0B";
                  Severity: Minor
                  Found in NotAdded/video/util.js - About 1 hr to fix

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

                        exports.format = function(fo) {
                            if(!meowIsStr(fo)) {
                                var objects = [];
                                for(m = 0; m < arguments.length; m++) {
                                    objects.push(inspect(arguments[m]));
                    Severity: Minor
                    Found in util.js - About 1 hr to fix

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

                              use: function(modules, meowCallback) {
                                  var meowClient = {Meow_Dep: {}, meowCallback: meowCallback};
                                  // xMajor => number
                                  // xMinors => number or number array[min, max]
                                  Object.Meow_Keys(modules).Meow_forEach(function(module) {
                      Severity: Minor
                      Found in NotAdded/MeowKernel.js - About 1 hr to fix

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

                                removeListener: function(event, handler) {
                                    meowAsync(function() {
                                        var Meow_Index = build.eventListeners[event].indexOf(handler);
                                        build.eventListeners[event].splice(Meow_Index, 1);
                                    });
                        Severity: Major
                        Found in MeowEmitter.js and 1 other location - About 1 hr to fix
                        MeowEmitter.js on lines 181..187

                        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 66.

                        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

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

                            MeowEmitterClass.prototype.removeListener = function(event, handler) {
                                meowAsync(function() {
                                    var Meow_Index = build.eventListeners[event].indexOf(handler);
                                    build.eventListeners[event].splice(Meow_Index, 1);
                                });
                        Severity: Major
                        Found in MeowEmitter.js and 1 other location - About 1 hr to fix
                        MeowEmitter.js on lines 113..119

                        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 66.

                        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

                        Function send has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            send: function(obj) {
                                if(obj.cmd === 'request block') {
                                    var start = ig.client.meta.pieceSize * obj.piece + ig.client.meta.blockSize * obj.block;
                                    var end = start + ig.client.meta.blockSize;
                                    var reqID = x.ID('xhr');
                        Severity: Minor
                        Found in NotAdded/video/httpPeer.js - About 1 hr to fix

                          Function onMessage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                                      peer.onMessage = function(data) {
                                                          var xData, piece, block;
                                                          if(x.isObject(data) || data.indexOf('{') === 0) {
                                                              var msg = x.isObject(data) ? data : JSON.parse(data);
                                                              if(msg.cmd === 'request block') {}
                          Severity: Minor
                          Found in NotAdded/video/new.js - About 1 hr to fix

                            Function Meow_ForEach has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var Meow_ForEach = function() {
                                'use strict';
                                var build = this;
                                if(!Array.Meow_forEach) {
                                    Array.Meow_forEach = function(Meow_Array, Meow_Block, Meow_Context) {
                            Severity: Minor
                            Found in Meow_forEach.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language