FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

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

                    if(this.__tmp_block instanceof CLASS.DataBlock || this.__tmp_block.stack.length>0){
                        this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
                        this.__tmp_block = new CLASS.BasicBlock();
                    }
Severity: Major
Found in src/SmaliParser.js and 1 other location - About 1 hr to fix
src/SmaliParser.js on lines 506..509

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

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

        for(let i=0; i<this.files.length; i++)
            if(this.files[i] != null && this.files[i][cmp](format))
                coll.pushFile(this.files[i]);
Severity: Major
Found in src/DataAnalyzer.js and 1 other location - About 1 hr to fix
src/DataAnalyzer.js on lines 79..81

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

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

                    this.metharea.setGlobalSymbol(
                        `${oper.right.enclosingClass.name}.${oper.right.name}`, 
                        DTYPE.FIELD, 
                        regV.getValue(), 
                        `${v[0]} = ${v[1]}`);
Severity: Major
Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
src/SmaliVM.js on lines 3884..3888

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

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

    IGET:{ byte:0x52, instr:"iget", parse: MainParser.multRegField, type: CONST.INSTR_TYPE.GETTER, reftype:ReferenceType.FIELD, format:Format.Format22c, flag:Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_REGISTER },
Severity: Major
Found in src/Opcode.js and 3 other locations - About 1 hr to fix
src/Opcode.js on lines 780..780
src/Opcode.js on lines 892..892
src/Opcode.js on lines 912..912

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

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(this.isImm(regV)){
                            regX = this.getSymbol(this.getRegisterName(oper.left[0]));

                            v = `${this.getRegisterName(oper.left[0])} = ${this.getImmediateValue(oper.left[1])}+${this.getRegisterName(oper.right)};`;
                            regX.setCode(v);
Severity: Major
Found in src/Decompiler.js and 1 other location - About 1 hr to fix
src/Decompiler.js on lines 1089..1101

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

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(this.isImm(regV)){

                            regX = this.getRegisterName(oper.left[0]);
                            regX = this.getSymbol(regX);

Severity: Major
Found in src/Decompiler.js and 1 other location - About 1 hr to fix
src/Decompiler.js on lines 1062..1073

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

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

    INVOKE_VIRTUAL:{ byte:0x6e, instr:"invoke-virtual", parse: MainParser.invoke, type: CONST.INSTR_TYPE.INVOKE, reftype:ReferenceType.METHOD, format:Format.Format35c, flag:Opcode.CAN_THROW | Opcode.CAN_CONTINUE | Opcode.SETS_RESULT },
Severity: Major
Found in src/Opcode.js and 3 other locations - About 1 hr to fix
src/Opcode.js on lines 780..780
src/Opcode.js on lines 796..796
src/Opcode.js on lines 912..912

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

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

        for(let i=0; i<this.buffers.length; i++)
            if(this.buffers[i] != null && this.buffers[i][cmp](format))
                coll.pushBuffer(this.buffers[i]);
Severity: Major
Found in src/DataAnalyzer.js and 1 other location - About 1 hr to fix
src/DataAnalyzer.js on lines 75..77

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

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(this.__tmp_block instanceof CLASS.DataBlock || this.__tmp_block.stack.length>0){
                        this.__tmp_meth.appendBlock(this.__tmp_block, this.__appendBlock_callback);
                        this.__tmp_block = new CLASS.BasicBlock();
                    }
Severity: Major
Found in src/SmaliParser.js and 1 other location - About 1 hr to fix
src/SmaliParser.js on lines 470..473

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

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 scan has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    async scan(){
        let dev=[], wrapper=null, activeDev = 0, latestDefault=null;

        latestDefault = this.getDefault();

Severity: Minor
Found in src/DeviceManager.js - About 1 hr to fix

    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 __checkDeepField has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          __checkDeepField(object,search, offset=0){
              let ref=object, i=offset;
      
              if(object == null) return false;
      
      
      Severity: Minor
      Found in src/Finder.js - About 1 hr to fix

        Function hook.reflect.method.get has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                "hook.reflect.method.get": function (ctx, event) {
                    Logger.info("[INSPECTOR][TASK] DynLoaderInspector search Method ");
        
                    //console.log(event);
                    if (event == null || event.data == null || event.data.data == null) return false;
        Severity: Minor
        Found in inspectors/DynamicLoader/main.js - About 1 hr to fix

          Function getBinding has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.getBinding = function(bind,clsFqcn){
                  let cls=null, ef=null, x=null, hash=null;
                  
                  if(clsFqcn === undefined)
                      clsFqcn = bind.fqcn; 
          Severity: Minor
          Found in src/VM.js - About 1 hr to fix

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

            const ChunkType = {
              NULL: 0x0000,
              STRING_POOL: 0x0001,
              TABLE: 0x0002,
              XML: 0x0003,
            Severity: Major
            Found in src/libs/BinaryXmlParser.js and 1 other location - About 1 hr to fix
            src/CoreClass.js on lines 10..26

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

            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

            var STUB_TYPE={
                METHOD: 0x1,
                FIELD: 0x2,
                ANNOTATION: 0x3,
                INSTR: 0x4,
            Severity: Major
            Found in src/CoreClass.js and 1 other location - About 1 hr to fix
            src/libs/BinaryXmlParser.js on lines 11..27

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

            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 fromString has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                static fromString( pType, pArrayStr){
                    const RE  = new RegExp('[\s\t]*\[[\s\t]*(?<ctn>.*)[\s\t]*\][\s\t]*');
                    let m = RE.exec(pArrayStr);
                    if(m == null){
                        throw new VM_Exception('VM002','Unable to parse bytearray parameter: invalid format');
            Severity: Minor
            Found in src/SmaliVM.js - About 1 hr to fix

              Function getImmediateValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  getImmediateValue(pSymbol, pSeparator="", pForce=false){
                      let v="";
                      switch(pSymbol.type)
                      {
                          case DTYPE.IMM_STRING:
              Severity: Minor
              Found in src/SmaliVM.js - About 1 hr to fix

                Function deploy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                HookSet.prototype.deploy = function(){
                    let hookManager = this.context.hook; //ctx.hook;
                    let hook, method, hconfig;
                
                    // if the hookset is already deployed only not deployed hooks are generated
                Severity: Minor
                Found in src/HookManager.js - About 1 hr to fix

                  Function toScript has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      toScript(indentLevel=1){
                          let entry=null, out=`{
                  `;
                  
                          for(let i=0; i<this.entries.length; i++){
                  Severity: Minor
                  Found in src/JavaScriptHelper.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language