FrenchYeti/dexcalibur

View on GitHub
src/Analyzer.js

Summary

Maintainability
F
1 wk
Test Coverage

File Analyzer.js has 808 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// global
var fs = require("fs");
var Chalk = require("chalk");

var ut = require("./Utils.js");
Severity: Major
Found in src/Analyzer.js - About 1 day to fix

    Function mapInstructionFrom has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
    Open

    function mapInstructionFrom(method, data, stats){
        let bb = null, instruct = null, obj = null, x = null, success=false, stmt=null, tmp=null, t=0,t1=0;
    
        if(! method instanceof CLASS.Method){
            Logger.error("[!] mapping failed : method provided is not an instance of Method.");
    Severity: Minor
    Found in src/Analyzer.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 MakeMap has 159 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function MakeMap(data,absoluteDB){
        
        Logger.raw("\n[*] Start object mapping ...\n------------------------------------------");
        let step = data.classes.size(), /*data.classesCtr,*/ g=0;   
        let overrided = [];
    Severity: Major
    Found in src/Analyzer.js - About 6 hrs to fix

      Function mapInstructionFrom has 121 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function mapInstructionFrom(method, data, stats){
          let bb = null, instruct = null, obj = null, x = null, success=false, stmt=null, tmp=null, t=0,t1=0;
      
          if(! method instanceof CLASS.Method){
              Logger.error("[!] mapping failed : method provided is not an instance of Method.");
      Severity: Major
      Found in src/Analyzer.js - About 4 hrs to fix

        Function Analyzer has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Analyzer(encoding, finder, ctx=null){
            SmaliParser.setContext(ctx);
        
            var db = this.db = new AnalyzerDatabase(ctx);
        
        
        Severity: Major
        Found in src/Analyzer.js - About 2 hrs to fix

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

          Analyzer.prototype.showCFG = function(bblocks, offset=0, prefix="", fn=null){
          
              if(bblocks.length==0 || bblocks[offset]==undefined){
                  Logger.debug(offset+" => not block");
                  return null;
          Severity: Minor
          Found in src/Analyzer.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 makeTree has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Analyzer.prototype.makeTree = function(bblocks){
              let last = {};
              for(let i=0; i<bblocks.length; i++){
                  bblocks[i].offset = i;
                  if(bblocks[i].stack.length > 0){
          Severity: Minor
          Found in src/Analyzer.js - About 1 hr to fix

            Function resolveInheritedField has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function resolveInheritedField(fieldRef, parentClass){
                for(let i in parentClass.fields){
                    if(parentClass.fields[i].name===fieldRef.name){
                        if(parentClass.fields[i].tags.indexOf('missing')>-1){
                            return parentClass.fields[i];
            Severity: Minor
            Found in src/Analyzer.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 resolveInheritedMethod has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function resolveInheritedMethod(methodRef, parentClass){
                for(let i in parentClass.methods){
                    if(parentClass.methods[i].name===methodRef.name){
                        if(parentClass.methods[i].tags.indexOf('missing')>-1){
                            return parentClass.methods[i];
            Severity: Minor
            Found in src/Analyzer.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 showCFG_old has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            Analyzer.prototype.showCFG_old = function(bblocks, prefix=""){
            
                let pathTRUE = Chalk.green(prefix+"    |\n"+prefix+"    |\n"+prefix+"    |\n"+prefix+"    +-----[TRUE]-->");
                let path_len = "    +-----[TRUE]-->".length;
                let pathFALSE = Chalk.red(prefix+"    |\n"+prefix+"    |\n"+prefix+"    |\n"+prefix+"    +-----[FALSE]->");
            Severity: Minor
            Found in src/Analyzer.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 showCFG has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Analyzer.prototype.showCFG = function(bblocks, offset=0, prefix="", fn=null){
            
                if(bblocks.length==0 || bblocks[offset]==undefined){
                    Logger.debug(offset+" => not block");
                    return null;
            Severity: Minor
            Found in src/Analyzer.js - About 1 hr to fix

              Function makeTree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              Analyzer.prototype.makeTree = function(bblocks){
                  let last = {};
                  for(let i=0; i<bblocks.length; i++){
                      bblocks[i].offset = i;
                      if(bblocks[i].stack.length > 0){
              Severity: Minor
              Found in src/Analyzer.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 method has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  method: function(db, methRef, isStaticCall){
              
                      let meth = db.methods.getEntry(methRef.signature());
              
                      // 1. search into indexed method 
              Severity: Minor
              Found in src/Analyzer.js - About 1 hr to fix

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

                Analyzer.prototype.showCFG_old = function(bblocks, prefix=""){
                
                    let pathTRUE = Chalk.green(prefix+"    |\n"+prefix+"    |\n"+prefix+"    |\n"+prefix+"    +-----[TRUE]-->");
                    let path_len = "    +-----[TRUE]-->".length;
                    let pathFALSE = Chalk.red(prefix+"    |\n"+prefix+"    |\n"+prefix+"    |\n"+prefix+"    +-----[FALSE]->");
                Severity: Minor
                Found in src/Analyzer.js - About 1 hr to fix

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

                  Analyzer.prototype.findBasicBlocks = function(instr){
                      let bblocks = [], blk={};
                  
                      blk = {stack:[], next:[], label:null };
                      for(let i in instr){
                  Severity: Minor
                  Found in src/Analyzer.js - About 1 hr to fix

                    Function findBasicBlocks has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Analyzer.prototype.findBasicBlocks = function(instr){
                        let bblocks = [], blk={};
                    
                        blk = {stack:[], next:[], label:null };
                        for(let i in instr){
                    Severity: Minor
                    Found in src/Analyzer.js - About 55 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 flattening has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Analyzer.prototype.flattening = function(method){
                        let instr = [], meta={};
                        for(let i in method.instr){
                            meta = {
                                label: (method.instr[i].tag !== null)? method.instr[i].tag : null,
                    Severity: Minor
                    Found in src/Analyzer.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

                                    if(instruct.isSetter()){
                                        instruct.right.addSetter(method);
                                    }else{
                                        instruct.right.addGetter(method);
                                    }
                    Severity: Major
                    Found in src/Analyzer.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  else if(instruct.isUsingString()){
                      
                                      // add USAGE: NEW/READ/WRITE
                      
                                      data.strings.insert(new CLASS.StringValue({ 
                      Severity: Major
                      Found in src/Analyzer.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if(method._useClass[instruct.right.fqcn] == undefined){
                                            method._useClass[instruct.right.fqcn] = [];
                                            method._useClassCtr++;
                                        }
                        Severity: Major
                        Found in src/Analyzer.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          if(instruct.right === undefined || instruct.right._callers === undefined){
                                              Logger.debug("[SAST] Call : method cannot be resolved : ", instruct);
                                          }
                          Severity: Major
                          Found in src/Analyzer.js - About 45 mins to fix

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

                                method: function(db, methRef, isStaticCall){
                            
                                    let meth = db.methods.getEntry(methRef.signature());
                            
                                    // 1. search into indexed method 
                            Severity: Minor
                            Found in src/Analyzer.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

                                                if(t !==null)
                                                    stmt[j].setTarget(t);
                                                else{
                                                    Logger.error("Target catch block not found");
                                                    console.log( stmt[j].getTarget());
                            Severity: Major
                            Found in src/Analyzer.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                              if(instruct.right == null){
                                                  Logger.debug("[SAST] Call : method name is null");
                                              }
                              Severity: Major
                              Found in src/Analyzer.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                if(method._useField[instruct.right.signature()] == undefined){
                                                    method._useField[instruct.right.signature()] = [];
                                                    method._useFieldCtr++;
                                                }
                                Severity: Major
                                Found in src/Analyzer.js - About 45 mins to fix

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

                                      field: function(db, fieldRef){
                                  
                                          let field = db.fields.getEntry(fieldRef.signature());
                                  
                                          if(field instanceof CLASS.Field){
                                  Severity: Minor
                                  Found in src/Analyzer.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 createMissingField( fieldRef, cls, db);
                                  Severity: Major
                                  Found in src/Analyzer.js - About 30 mins to fix

                                    Function useSyscalls has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    Analyzer.prototype.useSyscalls = function(syscalls){
                                        //this.db.syscalls = {};
                                        for(let i=0; i<syscalls.length ; i++){
                                            for(let j=0; j<syscalls[i].sysnum.length; j++){
                                                if(syscalls[i].sysnum[j]>-1){
                                    Severity: Minor
                                    Found in src/Analyzer.js - About 25 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 Analyzer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function Analyzer(encoding, finder, ctx=null){
                                        SmaliParser.setContext(ctx);
                                    
                                        var db = this.db = new AnalyzerDatabase(ctx);
                                    
                                    
                                    Severity: Minor
                                    Found in src/Analyzer.js - About 25 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 type has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        type: function(db, fqcn){
                                    
                                            if(fqcn instanceof CLASS.Class){ 
                                                if(db.classes.hasEntry(fqcn.fqcn)===true)
                                                    return db.classes.getEntry(fqcn.fqcn);
                                    Severity: Minor
                                    Found in src/Analyzer.js - About 25 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 insertIn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    Analyzer.prototype.insertIn = function(category, inData){
                                        if(inData instanceof Array){
                                            for(let i=0; i<inData.length; i++){
                                                this.db[category].insert(inData[i]);
                                            }
                                    Severity: Minor
                                    Found in src/Analyzer.js - About 25 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

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

                                    function resolveInheritedMethod(methodRef, parentClass){
                                        for(let i in parentClass.methods){
                                            if(parentClass.methods[i].name===methodRef.name){
                                                if(parentClass.methods[i].tags.indexOf('missing')>-1){
                                                    return parentClass.methods[i];
                                    Severity: Major
                                    Found in src/Analyzer.js and 1 other location - About 1 day to fix
                                    src/Analyzer.js on lines 38..57

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

                                    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

                                    function resolveInheritedField(fieldRef, parentClass){
                                        for(let i in parentClass.fields){
                                            if(parentClass.fields[i].name===fieldRef.name){
                                                if(parentClass.fields[i].tags.indexOf('missing')>-1){
                                                    return parentClass.fields[i];
                                    Severity: Major
                                    Found in src/Analyzer.js and 1 other location - About 1 day to fix
                                    src/Analyzer.js on lines 61..80

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

                                    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

                                                        case CONST.BRANCH.IF_TRUE:
                                                            Logger.info(prefix+Chalk.bold.green("if TRUE :"));
                                                            this.showBlock(bblocks[i].next[j].block, prefix, Chalk.green); 
                                                            break;
                                    Severity: Minor
                                    Found in src/Analyzer.js and 1 other location - About 55 mins to fix
                                    src/Analyzer.js on lines 1130..1133

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

                                    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

                                                        case CONST.BRANCH.IF_FALSE:
                                                            Logger.info(prefix+Chalk.bold.red("if FALSE :"));
                                                            this.showBlock(bblocks[i].next[j].block, prefix, Chalk.red);
                                                            break;
                                    Severity: Minor
                                    Found in src/Analyzer.js and 1 other location - About 55 mins to fix
                                    src/Analyzer.js on lines 1126..1129

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

                                    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

                                                    if(method._useField[instruct.right.signature()] == undefined){
                                                        method._useField[instruct.right.signature()] = [];
                                                        method._useFieldCtr++;
                                                    }
                                    Severity: Minor
                                    Found in src/Analyzer.js and 1 other location - About 35 mins to fix
                                    src/Analyzer.js on lines 339..342

                                    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

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

                                                    if(method._useMethod[instruct.right.signature()] == undefined){
                                                        method._useMethod[instruct.right.signature()] = [];
                                                        method._useMethodCtr++;
                                                    }
                                    Severity: Minor
                                    Found in src/Analyzer.js and 1 other location - About 35 mins to fix
                                    src/Analyzer.js on lines 399..402

                                    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

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

                                            if(cls.extends !== null){ 
                                                field = resolveInheritedField(fieldRef, cls.extends);
                                                
                                                if(field instanceof CLASS.Field){
                                                    cls.addInheritedField(fieldRef, field);
                                    Severity: Minor
                                    Found in src/Analyzer.js and 1 other location - About 35 mins to fix
                                    src/Analyzer.js on lines 239..248

                                    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

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

                                                if(cls.extends instanceof CLASS.Class){
                                                    meth = resolveInheritedMethod(methRef, cls.extends);
                                        
                                                    if(meth instanceof CLASS.Method){
                                                        cls.addInheritedMethod(methRef, meth);
                                    Severity: Minor
                                    Found in src/Analyzer.js and 1 other location - About 35 mins to fix
                                    src/Analyzer.js on lines 200..209

                                    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

                                    There are no issues that match your filters.

                                    Category
                                    Status