FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

Function execute has a Cognitive Complexity of 453 (exceeds 5 allowed). Consider refactoring.
Open

    execute( pInstrStack, pInstrOffset){
        let ops = [], dec=[],  f={res:false}, v='', regX=null,  regV=null, regZ=null, label=null, oper=null, tmp=[];
        let state = { code:[], jump:null, ret:null, inv:null};
        let regs = {};
        let indent = "    ".repeat(this.depth);
Severity: Minor
Found in src/SmaliVM.js - About 1 wk 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 SmaliVM.js has 3031 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const CLASS = require("./CoreClass.js");
const CONST = require("./CoreConst.js");
const OPCODE = require('./Opcode.js').OPCODE;
Severity: Major
Found in src/SmaliVM.js - About 1 wk to fix

    Function initRoutes has 1442 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        initRoutes() {
            let $ = this;
    
            this.controller = this.newDispatcher("index.html");
    
    
    Severity: Major
    Found in src/WebServer.js - About 1 wk to fix

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

      class AndroidReceiver
      {
          
          constructor(config=null){
              // the manifest data are stored here
      Severity: Major
      Found in src/AndroidAppComponents.js and 1 other location - About 6 days to fix
      src/AndroidAppComponents.js on lines 1014..1189

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

      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

      class AndroidService
      {
          
          constructor(config=null){
              // the manifest data are stored here
      Severity: Major
      Found in src/AndroidAppComponents.js and 1 other location - About 6 days to fix
      src/AndroidAppComponents.js on lines 1191..1362

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

      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

      File CoreClass.js has 2248 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var CONST = require("./CoreConst.js");
      const NodeCompare = require("./NodeCompare.js");
      const Accessor = require('./AccessFlags');
      
      const EOL =  require('os').EOL ;
      Severity: Major
      Found in src/CoreClass.js - About 6 days to fix

        Function execute has 1158 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            execute( pInstrStack, pInstrOffset){
                let ops = [], dec=[],  f={res:false}, v='', regX=null,  regV=null, regZ=null, label=null, oper=null, tmp=[];
                let state = { code:[], jump:null, ret:null, inv:null};
                let regs = {};
                let indent = "    ".repeat(this.depth);
        Severity: Major
        Found in src/SmaliVM.js - About 5 days to fix

          File Syscalls.js has 1964 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const CLASS = require('./CoreClass.js');
          
          const SYSCALLS = [
          
              new CLASS.Syscall({
          Severity: Major
          Found in src/Syscalls.js - About 5 days to fix

            Function simplifyBasicBlock has a Cognitive Complexity of 249 (exceeds 5 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: Minor
            Found in src/Decompiler.js - About 5 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

            File WebServer.js has 1641 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const Express = require("express");
            const fs = require("fs");
            const MIME = require("mime-types");
            const Chalk = require("chalk");
            const VM = require("vm");
            Severity: Major
            Found in src/WebServer.js - About 4 days to fix

              File AndroidAppComponents.js has 1529 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              const Logger = require('./Logger.js')();
              const _md5_ = require('md5');
              
              const ANDROID_PREFIX = "android:";
              const ANDROID_PREFIX_LEN = 8;
              Severity: Major
              Found in src/AndroidAppComponents.js - About 4 days to fix

                Function decompileBasicBlock has a Cognitive Complexity of 196 (exceeds 5 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: Minor
                Found in src/Decompiler.js - About 4 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

                File Decompiler.js has 1334 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                'use strict';
                
                const CLASS = require("./CoreClass.js");
                const CONST = require("./CoreConst.js");
                const OPCODE = require('./Opcode.js').OPCODE;
                Severity: Major
                Found in src/Decompiler.js - About 3 days to fix

                  File HookManager.js has 1251 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  var FRIDA = null; 
                  const co = require("co");
                  const fs = require("fs");
                  const md5 = require("md5");
                  const Chalk = require("chalk");
                  Severity: Major
                  Found in src/HookManager.js - About 3 days to fix

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

                                    if(instr[k].opcode.type == CONST.INSTR_TYPE.IF){
                                        //console.log("IF-", instr[k]);
                                        next =  pMethod.getBasicBlockByLabel(instr[k].right.name, CONST.INSTR_TYPE.IF);
                                        Logger.debug(`Block ${i} IF => Block ${next.offset}`)
                                        blocks[i].addSuccessor(next);
                    Severity: Major
                    Found in src/Simplifier.js and 1 other location - About 3 days to fix
                    src/Decompiler.js on lines 1596..1629

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

                    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(instr[k].opcode.type == CONST.INSTR_TYPE.IF){
                                        //console.log("IF-", instr[k]);
                                        next =  pMethod.getBasicBlockByLabel(instr[k].right.name, CONST.INSTR_TYPE.IF);
                                        Logger.debug(`Block ${i} IF => Block ${next.offset}`)
                                        blocks[i].addSuccessor(next);
                    Severity: Major
                    Found in src/Decompiler.js and 1 other location - About 3 days to fix
                    src/Simplifier.js on lines 71..104

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

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

                    function save(data,file){
                        let tab={}, src={}, block=null;
                    
                    
                        for(let i in data.classes){
                    Severity: Minor
                    Found in src/BackupManager.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

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

                                    if(regs.src1.v!==null && regs.src2.v!==null){
                    
                                        regs.val= regs.src1.m[SYMBOL_OPE[oper.opcode.ope]]( 
                                            regs.src2.v, oper.opcode.byte, regs.src1.l.getValue());
                                    }
                    Severity: Major
                    Found in src/SmaliVM.js and 1 other location - About 2 days to fix
                    src/SmaliVM.js on lines 3217..3233

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

                    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

                                    if(regs.src1.v!==null && regs.src2.v!==null){
                    
                                        regs.val= regs.src1.m[SYMBOL_OPE[oper.opcode.ope]]( 
                                            regs.src2.v, oper.opcode.byte, regs.src1.l.getValue());
                                    }
                    Severity: Major
                    Found in src/SmaliVM.js and 1 other location - About 2 days to fix
                    src/SmaliVM.js on lines 3163..3179

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

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

                    function moveBasicBlock(method, bblocks, gotoLabel){
                        //console.log("Moving basic blocks "+bblocks.offset+"(len:"+bblocks.blk.length+") at instr goto_"+gotoLabel);
                        let bbs = [], flag=false, lastWasGoto=false, endbb=0, tmp=null;
                        // find cut point
                        if( method.instr != null && method.instr.length > 0){
                    Severity: Minor
                    Found in inspectors/BytecodeCleaner/service/main.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

                    Severity
                    Category
                    Status
                    Source
                    Language