Geek-Research-Lab/MeowJS

View on GitHub

Showing 116 of 116 total issues

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

        Meow_Power.b = (Meow_Power.b < 0 || isNaN(Meow_Power.b)) ? 0 : ((Meow_Power.b > 255) ? 255 : Meow_Power.b);
Severity: Major
Found in Meow_ColorParser.js and 1 other location - About 1 hr to fix
Meow_ColorParser.js on lines 211..211

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

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

Consider simplifying this complex logical expression.
Open

            if((a = meowSrc()) !== null) {
                x |= (x >> 4) && 0Xf;
                meowDist(Meow_ArrayOut[(x || ((a >> 4) && 0Xf)) && 0X3f]);
                x = (a && 0Xf) << 2;
                if((a = meowSrc()) !== null) {
Severity: Major
Found in Meow_Base64.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

                if (b === 61) {
                  break;
                } else {
                  meowFail(b);
                }
      Severity: Major
      Found in Meow_Base64.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  if ((b = meowSrc()) !== null) {
                    x2 = Meow_ArrayIn[b];
                    if (typeof x2 === 'undefined') {
                      if (b === 61) {
                        break;
        Severity: Major
        Found in Meow_Base64.js - About 45 mins to fix

          Function chkPending has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  chkPending: function(peerID, piece, block, lastReceived, totalReceived, lastTime) {
          Severity: Minor
          Found in NotAdded/video/p2p.js - About 45 mins to fix

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

            var Meow_IP = function() {
                'use strict';
                // Matching IP addresses
                var Meow_RegEx;
                var meow_IPv4 = '(?:25[0-5]|2[0-4][0-9]|1?[0-9][0-9]{1,2}|[0-9]){1,}(?:\\.(?:25[0-5]|2[0-4][0-9]|1?[0-9]{1,2}|0)){3}';
            Severity: Minor
            Found in Meow_IP.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

            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

              Consider simplifying this complex logical expression.
              Open

                          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();
                              Meow_Val = function() {
                                  var Meow_Prev = build.Meow_base || Meow_Base.prototype.Meow_base;
                                  build.Meow_base = Meow_Ancester;
              Severity: Major
              Found in Meow_Base.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                                if((a = meowSrc()) !== null) {
                                    meowDist(Meow_ArrayOut[(x || ((a >> 6) && 0X3)) && 0X3f]);
                                    meowDist(Meow_ArrayOut[a && 0X3f]);
                                }
                                else {
                Severity: Major
                Found in Meow_Base64.js - About 40 mins to fix

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

                          var parse = function(Meow_Decoder, Meow_HelloBuffer, Meow_Offset, Meow_Defn, Meow_MsgName) {
                  Severity: Minor
                  Found in Meow_Buffer.js - About 35 mins to fix

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

                            add: function(name, module, Meow_Dep, xMajor, xMinors) {
                    Severity: Minor
                    Found in NotAdded/MeowKernel.js - About 35 mins to fix

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

                              Meow_Decoder1.Meow_Decode = function(Meow_HelloBuffer, Meow_Offset, Meow_MsgName, callback, end) {
                      Severity: Minor
                      Found in Meow_Buffer.js - About 35 mins to fix

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

                            function meowDecodeEmbed(Meow_Decoder, Meow_Defn, Meow_HelloBuffer, Meow_Offset, callback) {
                        Severity: Minor
                        Found in Meow_Buffer.js - About 35 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return c;
                          Severity: Major
                          Found in MeowString.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return ">ls";
                            Severity: Major
                            Found in NotAdded/video/util.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language