FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

Function run has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
Open

    run( pStack, pDepth=0){
        let i=0, f=0, dec=null, msg=null, ctxRST=null, bbs=null, mode=SINGLE_MODE ;
        let indent = "    ".repeat(this.depth);

        // add emulated method to callstack;
Severity: Minor
Found in src/SmaliVM.js - About 2 days 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 simplifyBasicBlock has 446 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    simplifyBasicBlock(pBlock, pDepth=0){
        let ops = [], dec=[],  f={res:false}, v='', regX=null,  regV=null, oper=null, tmp=[];
        let indent = "    ".repeat(pDepth);

        ops = pBlock.getInstructions();  ;  
Severity: Major
Found in src/Decompiler.js - About 2 days to fix

    File main.js has 883 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const Inspector = require("../../src/Inspector.js");
    const InspectorFactory = require("../../src/InspectorFactory");
    const Android = require("../../src/AndroidAppComponents.js");
    
    // ===== INIT =====
    Severity: Major
    Found in inspectors/PermissionAnalyser/main.js - About 2 days to fix

      File Opcode.js has 865 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var CONST = require("./CoreConst.js");
      var Core = require("./CoreParser.js");
      const CLASS = require("./CoreClass.js");
      var ut = require("./Utils.js");
      
      
      Severity: Major
      Found in src/Opcode.js - About 2 days to fix

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

            method(src, raw_src, src_line){
                if(this.state != SML_METH) return null;
                
                let sml=src, hdl=null, catchStmt=null, tmp=null;
        
        
        Severity: Minor
        Found in src/SmaliParser.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

        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

          File Finder.js has 781 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var ut = require("./Utils.js");
          const CLASS = require("./CoreClass.js");
          const FILE = require("./File.js");
          const Logger = require("./Logger.js")();
          var CONST = require("./CoreConst.js");
          Severity: Major
          Found in src/Finder.js - About 1 day to fix

            Function decompileBasicBlock has 334 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                decompileBasicBlock(pBlock, pDepth=0){
                    let ops = [], dec=[],  f={res:false}, v='', regX=null,  regV=null, oper=null, tmp=[];
                    let indent = "    ".repeat(pDepth);
            
                    ops = pBlock.getInstructions();  ;  
            Severity: Major
            Found in src/Decompiler.js - About 1 day to fix

              Function methodRaw has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
              Open

              Disassembler.prototype.methodRaw = function(method){
              
                  let bb=null, txt="", prefix="", bbe={}, line={}, result=[], c={};
                  
                  for(let i in method.instr){
              Severity: Minor
              Found in src/Disassembler.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

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

                              case OPCODE.IGET_BOOLEAN.byte:
                                  regX = this.getRegisterName(oper.left[0]);
                                  regV = oper.right.type.name;
                                  
                                  if(this.getRegisterName(oper.left[1])=="p0" && (this.method.modifiers.static==false)){
              Severity: Major
              Found in src/Decompiler.js and 2 other locations - About 1 day to fix
              src/Decompiler.js on lines 710..728
              src/Decompiler.js on lines 1268..1286

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

              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 3 locations. Consider refactoring.
              Open

                              case OPCODE.IGET_BOOLEAN.byte:
                                  regX = this.getRegisterName(oper.left[0]);
                                  regV = oper.right.type.name;
                                  
                                  if(this.getRegisterName(oper.left[1])=="p0" && (this.method.modifiers.static==false)){
              Severity: Major
              Found in src/Decompiler.js and 2 other locations - About 1 day to fix
              src/Decompiler.js on lines 1242..1260
              src/Decompiler.js on lines 1268..1286

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

              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 3 locations. Consider refactoring.
              Open

                              case OPCODE.SGET_BOOLEAN.byte:
                                  regX = this.getRegisterName(oper.left[0]);
                                  regV = oper.right.type.name;
                                  
                                  if(this.getRegisterName(oper.left[1])=="p0" && (this.method.modifiers.static==false)){
              Severity: Major
              Found in src/Decompiler.js and 2 other locations - About 1 day to fix
              src/Decompiler.js on lines 710..728
              src/Decompiler.js on lines 1242..1260

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

              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 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 toJsonObject has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
              Open

              Method.prototype.toJsonObject = function(fields=[],exclude=[]){
                  let obj = new Object();
                  if(fields.length>0){
                      for(let i=0; i<fields.length; i++){
                          if(this[fields[i]] != null && this[fields[i]].toJsonObject != null){
              Severity: Minor
              Found in src/CoreClass.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

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

                              case OPCODE.RETURN.byte:
                                  regX = this.getRegisterName(oper.left);
                                  regV = this.getSymbol(regX);
              
                                  if((regX=="p0") && (this.method.modifiers.static==false)){
              Severity: Major
              Found in src/Decompiler.js and 1 other location - About 1 day to fix
              src/Decompiler.js on lines 1343..1363

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

              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 OPCODE.RETURN.byte:
                                  regX = this.getRegisterName(oper.left);
                                  regV = this.getSymbol(regX);
              
                                  if((regX=="p0") && (this.method.modifiers.static==false)){
              Severity: Major
              Found in src/Decompiler.js and 1 other location - About 1 day to fix
              src/Decompiler.js on lines 779..799

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

              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 3 locations. Consider refactoring.
              Open

                      "app.receiver.new": function (ctx, event) {
                  
                          let cls = ctx.find.get.class(event.data.name)
                          if (cls instanceof CLASS.Class) {
                              event.data.setImplementedBy(cls);
              Severity: Major
              Found in inspectors/ApplicationTopography/main.js and 2 other locations - About 1 day to fix
              inspectors/ApplicationTopography/main.js on lines 136..166
              inspectors/ApplicationTopography/main.js on lines 167..196

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

              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 3 locations. Consider refactoring.
              Open

                      "app.provider.new": function (ctx, event) {
                      
                          let cls = ctx.find.get.class(event.data.name);
                          if (cls instanceof CLASS.Class) {
                              event.data.setImplementedBy(cls);
              Severity: Major
              Found in inspectors/ApplicationTopography/main.js and 2 other locations - About 1 day to fix
              inspectors/ApplicationTopography/main.js on lines 105..135
              inspectors/ApplicationTopography/main.js on lines 167..196

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

              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 3 locations. Consider refactoring.
              Open

                      "app.service.new": function (ctx, event) {
                      
                              let cls = ctx.find.get.class(event.data.name);
                              if (cls instanceof CLASS.Class) {
                                  event.data.setImplementedBy(cls);
              Severity: Major
              Found in inspectors/ApplicationTopography/main.js and 2 other locations - About 1 day to fix
              inspectors/ApplicationTopography/main.js on lines 105..135
              inspectors/ApplicationTopography/main.js on lines 136..166

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

              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 OPCODE.MOVE_RESULT_WIDE.byte:
              //                        console.log(oper);
              
                                  regX = this.getRegisterName(oper.left);
                                  if(this.invokes.length > 0){
              Severity: Major
              Found in src/Decompiler.js and 1 other location - About 1 day to fix
              src/Decompiler.js on lines 1106..1136

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

              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

              Severity
              Category
              Status
              Source
              Language