FrenchYeti/dexcalibur

View on GitHub
src/SmaliVM.js

Summary

Maintainability
F
2 mos
Test Coverage

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

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

          analyzeBlocks(pMethod){
              
              let blocks =  pMethod.getBasicBlocks();
      
              if(blocks.length == 0) return null;
      Severity: Minor
      Found in src/SmaliVM.js - About 6 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 writeIndirectInvoke has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

          writeIndirectInvoke( pInvokerObjRef, pInvokerArgRef, pInvokedMethod, pObj, pArgs){
              let irObj=null, irArg=null, ivObj=null, ivArg=null,  v = null, rThis=null, vThis=0, rArg=null, vArg=null;
      
              irObj = this.vm.getRegisterName(pInvokerObjRef);
              ivObj = this.vm.stack.getLocalSymbol(irObj); 
      Severity: Minor
      Found in src/SmaliVM.js - About 6 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 start has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

          start( pMethod, pThis, pArguments=null, pClearHeap=false){
              let opt = null, margs=null, arr=null;
      
              // clean StackMemory 
              this.stack.clear();
      Severity: Minor
      Found in src/SmaliVM.js - About 6 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

      VM has 42 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class VM
      {
      
          /**
           * Instance of the VM  
      Severity: Minor
      Found in src/SmaliVM.js - About 5 hrs to fix

        Function run has 136 lines of code (exceeds 25 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: Major
        Found in src/SmaliVM.js - About 5 hrs to fix

          Function performBinaryOp has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

              performBinaryOp( pOpCode, pType, pDest, pSrc1, pSrc2=null){
          
                  let dst = null, src1 = null, src2 = null;
          
                  src1 = { 
          Severity: Minor
          Found in src/SmaliVM.js - About 4 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 performBinaryOp has 108 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              performBinaryOp( pOpCode, pType, pDest, pSrc1, pSrc2=null){
          
                  let dst = null, src1 = null, src2 = null;
          
                  src1 = { 
          Severity: Major
          Found in src/SmaliVM.js - About 4 hrs to fix

            Function writeInvoke has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                writeInvoke( pMethodRef, pParamsReg){
                    let v = null, rThis=null, vThis=0, rArg=null, vArg=null;
            
                    if(pParamsReg.length > 0){
                        rThis = this.vm.getRegisterName(pParamsReg[0]);
            Severity: Minor
            Found in src/SmaliVM.js - About 3 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

            Symbol has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Symbol
            {
                static SKIPPED = true;
            
                constructor(pVisibility, pType, pValue, pCode=null, pSkipped=false){
            Severity: Minor
            Found in src/SmaliVM.js - About 3 hrs to fix

              Function getMethodFromClass has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                  getMethodFromClass( pClass, pName, pArgs){
                      let ok = null, arg=null;
                      let meths = pClass.getMethod({ name:pName }, CONST.EXACT_MATCH);
              
                      if(meths.length==0) return null;
              Severity: Minor
              Found in src/SmaliVM.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 writeIndirectInvoke has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  writeIndirectInvoke( pInvokerObjRef, pInvokerArgRef, pInvokedMethod, pObj, pArgs){
                      let irObj=null, irArg=null, ivObj=null, ivArg=null,  v = null, rThis=null, vThis=0, rArg=null, vArg=null;
              
                      irObj = this.vm.getRegisterName(pInvokerObjRef);
                      ivObj = this.vm.stack.getLocalSymbol(irObj); 
              Severity: Major
              Found in src/SmaliVM.js - About 2 hrs to fix

                Function analyzeBlocks has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    analyzeBlocks(pMethod){
                        
                        let blocks =  pMethod.getBasicBlocks();
                
                        if(blocks.length == 0) return null;
                Severity: Major
                Found in src/SmaliVM.js - About 2 hrs to fix

                  Function start has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      start( pMethod, pThis, pArguments=null, pClearHeap=false){
                          let opt = null, margs=null, arr=null;
                  
                          // clean StackMemory 
                          this.stack.clear();
                  Severity: Major
                  Found in src/SmaliVM.js - About 2 hrs to fix

                    Function writeInvoke has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        writeInvoke( pMethodRef, pParamsReg){
                            let v = null, rThis=null, vThis=0, rArg=null, vArg=null;
                    
                            if(pParamsReg.length > 0){
                                rThis = this.vm.getRegisterName(pParamsReg[0]);
                    Severity: Minor
                    Found in src/SmaliVM.js - About 1 hr to fix

                      Function fromString has a Cognitive Complexity of 14 (exceeds 5 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

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

                          load( pClass, pExecClinit=true){
                              let clz = null;
                              
                              if(pClass instanceof CLASS.Class){
                                  if(this.classes[pClass.name] != undefined) 
                      Severity: Minor
                      Found in src/SmaliVM.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 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 toString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              toString(){
                                  let v = '[', e=null;
                                  //console.log(this);
                                  for(let i=0; i<this.value.length; i++){
                                      e = this.value[i];
                          Severity: Minor
                          Found in src/SmaliVM.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 load has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              load( pClass, pExecClinit=true){
                                  let clz = null;
                                  
                                  if(pClass instanceof CLASS.Class){
                                      if(this.classes[pClass.name] != undefined) 
                          Severity: Minor
                          Found in src/SmaliVM.js - About 1 hr to fix

                            Function invoke has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                invoke( pMethod, pObj, pArgs){
                                    let opt = null;
                            
                                    // execute hooks 
                                    if(this.isHooked(pMethod)){
                            Severity: Minor
                            Found in src/SmaliVM.js - About 1 hr to fix

                              Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  constructor(pContext, pMethod = null, pLocalSize = null, pParamSize = null){
                                      
                                      this.context = pContext;
                              
                                      this.logs = new VM_Log();
                              Severity: Minor
                              Found in src/SmaliVM.js - About 1 hr to fix

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

                                    print(){
                                        let m=`
                                Call stack :
                                `;
                                
                                
                                Severity: Minor
                                Found in src/SmaliVM.js - About 1 hr to fix

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

                                  function getDataTypeOf(pType){
                                      //Logger.debug("getDataTypeOf: ",pType);
                                      if(pType instanceof CLASS.ObjectType){
                                          if(pType.isArray())
                                              return DTYPE.ARRAY;
                                  Severity: Minor
                                  Found in src/SmaliVM.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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                  if(bbs.isTryEndBlock()){
                                                      if(bbs.hasCatchStatement()){
                                                          d = bbs.getCatchStatements();
                                                          for(let i=0; i<d.length; i++){
                                                              if(d[i].getException() != null)
                                  Severity: Major
                                  Found in src/SmaliVM.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if(arg.name != meths[i].args[j]._name) 
                                                            ok=false;
                                    Severity: Major
                                    Found in src/SmaliVM.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if(pArguments["p"+i].val != null)
                                                                  this.stack.last().addArgument(i, getDataTypeOf(margs[i]), 
                                                                      this.heap.newInstance(margs[i]._name).setConcrete(pArguments["p"+i].val));
                                                              else if(pArguments["p"+i].notset==true)
                                                                  this.stack.last().addArgument(i, getDataTypeOf(margs[i]), this.heap.newInstance(margs[i]._name));
                                      Severity: Major
                                      Found in src/SmaliVM.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if(vArg.hasConcrete()){
                                                                v+= this.vm.pcmaker.renderConcrete(vArg);
                                                            }else{
                                                                v+= rArg;
                                                            }
                                        Severity: Major
                                        Found in src/SmaliVM.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if(blocks[i+1].hasPredecessor(blocks[i])==false){
                                                                      blocks[i+1].addPredecessor(blocks[i]);
                                                                  }
                                          Severity: Major
                                          Found in src/SmaliVM.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                        if(regV.hasCode()){
                                                                            this.stack.setLocalSymbol(
                                                                                regV, 
                                                                                DTYPE.IMM_NUMERIC,
                                                                                null,
                                            Severity: Major
                                            Found in src/SmaliVM.js - About 45 mins to fix

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

                                                  print(){
                                                      let m=`
                                              Call stack :
                                              `;
                                              
                                              
                                              Severity: Minor
                                              Found in src/SmaliVM.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(this.stack.callstack.length==1) this.pcmaker.turnOff();
                                              Severity: Major
                                              Found in src/SmaliVM.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if(bbs.hasMultiplePredecessors()){
                                                                        if(f>0) 
                                                                            this.pcmaker.push(`:goto_${bbs.getGotoLabel()}:`);
                                                                        else{
                                                                            this.pcmaker.push(`${CR}goto_${bbs.getGotoLabel()}:`);
                                                Severity: Major
                                                Found in src/SmaliVM.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                      if(next == null){
                                                                          
                                                                          Logger.error("[VM] Basic block 'goto_"+instr[k].right.name+"' targeted by goto is not found.");
                                                                      }
                                                  Severity: Major
                                                  Found in src/SmaliVM.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                        if(next.hasPredecessor(blocks[i])==false){
                                                                            next.addPredecessor(blocks[i]);
                                                                        }
                                                    Severity: Major
                                                    Found in src/SmaliVM.js - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                          if(blocks[i].hasSuccessor(next)==false){
                                                                              blocks[i].addSuccessor(next);
                                                                          }
                                                      Severity: Major
                                                      Found in src/SmaliVM.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                            if( (this.config.maxdepth==-1) || (this.config.maxdepth - this.stack.depth()) > 0){
                                                                                
                                                                                
                                                                                this.invoke( dec.inv.meth, dec.inv.obj, dec.inv.args);
                                                                                
                                                        Severity: Major
                                                        Found in src/SmaliVM.js - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                          else if(dec.ret != null){
                                                                              break;
                                                                          }
                                                                          else{
                                                                              i++;
                                                          Severity: Major
                                                          Found in src/SmaliVM.js - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                        if(regX.hasCode()){
                                                                                            this.stack.setLocalSymbol(
                                                                                                regV, 
                                                                                                DTYPE.IMM_NUMERIC,
                                                                                                null,
                                                            Severity: Major
                                                            Found in src/SmaliVM.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                              else if(instr[k].opcode.type == CONST.INSTR_TYPE.RET){
                                                                                  //Logger.debug(`Block ${i} RETURN`)
                                                                                  jump = true;
                                                                              }
                                                              Severity: Major
                                                              Found in src/SmaliVM.js - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                        if(regV.getValue() instanceof VM_ClassInstance){
                                                                
                                                                                            v = `// ${regX}=(ClassInstance)${regV.getValue().parent.name} is not null, so "if(${regX} == 0)" was FALSE. Continue ...`;
                                                                                            
                                                                                            //v = `${indent}if( ${regV.getValue().getConcrete()} != null ) ${label}`;
                                                                Severity: Major
                                                                Found in src/SmaliVM.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                          if(regV.getValue() instanceof VM_ClassInstance){
                                                                  
                                                                                              v = `// ${regX}=(ClassInstance)${regV.getValue().parent.name} is not null, so "if(${regX} != 0)" was TRUE. Continue ...`;
                                                                                              state.jump = {type:CONST.INSTR_TYPE.IF, label:oper.right.name};
                                                                                              
                                                                  Severity: Major
                                                                  Found in src/SmaliVM.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            if(pArguments["p"+i].val != null){
                                                                                                if(getDataTypeOf(margs[i])==DTYPE.ARRAY){
                                                                                                    // parse array string
                                                                                                    arr = VM_VirtualArray.fromString( margs[i].type, pArguments["p"+i].val);
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in src/SmaliVM.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if(f>0){
                                                                                              //ssmali.push(`${bbs.getCatchLabel()}:`);
                                                                                              this.pcmaker.push(`:${bbs.getCatchLabel()}`);
                                                                                          }else{
                                                                                              this.pcmaker.push(`${CR}${bbs.getCatchLabel()}`);
                                                                      Severity: Major
                                                                      Found in src/SmaliVM.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                            if(this.stack.callstack.length==1) this.pcmaker.turnOn();
                                                                        Severity: Major
                                                                        Found in src/SmaliVM.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                              if(f==0) 
                                                                                                  this.pcmaker.push(`try{`);
                                                                                              else
                                                                                                  this.pcmaker.push(`${CR}try{`);
                                                                          Severity: Major
                                                                          Found in src/SmaliVM.js - About 45 mins to fix

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

                                                                                print(){
                                                                                    if(this.value instanceof VM_ClassInstance){
                                                                                        return `type:${DTYPE_STRING[this.type]}, value:(ClassInstance)${this.value.parent.name}, code:${this.code}`;
                                                                                    }
                                                                                    else if(this.value instanceof CLASS.Class){
                                                                            Severity: Minor
                                                                            Found in src/SmaliVM.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

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

                                                                                findOffsetByLabel( pStack, pLabel, pType){
                                                                                    for(let i=0; i<pStack.length; i++){
                                                                                        if(pStack[i].t=='b'){
                                                                                            //console.log(pStack[i].i.getGotoLabel(), pLabel);
                                                                                            if(pType == CONST.INSTR_TYPE.IF && pStack[i].i.getCondLabel()==pLabel){
                                                                            Severity: Minor
                                                                            Found in src/SmaliVM.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 BTYPE_DTYPE[pType.name];
                                                                            Severity: Major
                                                                            Found in src/SmaliVM.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                          return BTYPE_DTYPE[pType.name];
                                                                              Severity: Major
                                                                              Found in src/SmaliVM.js - About 30 mins to fix

                                                                                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

                                                                                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

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

                                                                                            case OPCODE.IF_NE.byte:                
                                                                                                regX = this.getRegisterName(oper.left[0]);
                                                                                                regV = this.getRegisterName(oper.left[1]);
                                                                                                
                                                                                                label = `:cond_${oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 1 day to fix
                                                                                src/SmaliVM.js on lines 4035..4050
                                                                                src/SmaliVM.js on lines 4095..4110

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

                                                                                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.IF_GT.byte:                
                                                                                                regX = this.getRegisterName(oper.left[0]);
                                                                                                regV = this.getRegisterName(oper.left[1]);
                                                                                                
                                                                                                label = `:cond_${oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 1 day to fix
                                                                                src/SmaliVM.js on lines 4019..4034
                                                                                src/SmaliVM.js on lines 4035..4050

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

                                                                                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.IF_LT.byte:                
                                                                                                regX = this.getRegisterName(oper.left[0]);
                                                                                                regV = this.getRegisterName(oper.left[1]);
                                                                                                
                                                                                                label = `:cond_${oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 1 day to fix
                                                                                src/SmaliVM.js on lines 4019..4034
                                                                                src/SmaliVM.js on lines 4095..4110

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

                                                                                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

                                                                                    rem(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.REM_LONG_2ADDR.byte:
                                                                                            case OPCODE.REM_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) % pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 289..306
                                                                                src/SmaliVM.js on lines 345..361

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

                                                                                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

                                                                                    div(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.DIV_LONG_2ADDR.byte:
                                                                                            case OPCODE.DIV_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) / pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 289..306
                                                                                src/SmaliVM.js on lines 363..379

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

                                                                                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

                                                                                    add(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                
                                                                                            case OPCODE.ADD_LONG_2ADDR.byte:
                                                                                            case OPCODE.ADD_LONG.byte:
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 345..361
                                                                                src/SmaliVM.js on lines 363..379

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

                                                                                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

                                                                                                for(let i=0; i<d.length; i++){
                                                                                                    if(d[i].getException() != null)
                                                                                                        this.pcmaker.push(`${"    ".repeat(this.depth-1)}}catch(${d[i].getException().name}) ${d[i].getTarget().getCatchLabel()}`);
                                                                                                    else
                                                                                                        this.pcmaker.push(`${"    ".repeat(this.depth-1)}}catchall ${d[i].getTarget().getCatchLabel()}`);
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 2737..2742

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

                                                                                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

                                                                                                        for(let i=0; i<d.length; i++){
                                                                                                            if(d[i].getException() != null)
                                                                                                                this.pcmaker.push(`${"    ".repeat(this.depth-1)}}catch(${d[i].getException().name}) ${d[i].getTarget().getCatchLabel()}`);
                                                                                                            else
                                                                                                                this.pcmaker.push(`${"    ".repeat(this.depth-1)}}catchall ${d[i].getTarget().getCatchLabel()}`);
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 2771..2776

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

                                                                                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.IF_LEZ.byte:                
                                                                                                regX = this.getRegisterName(oper.left);
                                                                                                regV = this.stack.getLocalSymbol(regX);
                                                                                                
                                                                                                label = `:cond_${oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 4277..4288
                                                                                src/SmaliVM.js on lines 4289..4300

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

                                                                                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.IF_GEZ.byte:                
                                                                                                regX = this.getRegisterName(oper.left);
                                                                                                regV = this.stack.getLocalSymbol(regX);
                                                                                                
                                                                                                label = `:cond_${oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 4289..4300
                                                                                src/SmaliVM.js on lines 4301..4312

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

                                                                                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.IF_GTZ.byte:                
                                                                                                regX = this.getRegisterName(oper.left);
                                                                                                regV = this.stack.getLocalSymbol(regX);
                                                                                                
                                                                                                label = `:cond_${oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 4277..4288
                                                                                src/SmaliVM.js on lines 4301..4312

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

                                                                                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

                                                                                    mul(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.MUL_LONG.byte: 
                                                                                            case OPCODE.MUL_LONG_2ADDR.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) * pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 308..324

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

                                                                                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

                                                                                    sub(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.SUB_LONG_2ADDR.byte:
                                                                                            case OPCODE.SUB_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) - pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 6 hrs to fix
                                                                                src/SmaliVM.js on lines 326..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 184.

                                                                                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(this.isImm(regV)){
                                                                                //                                this.setSymbol(regX, regX.add(regV.getValue(), oper.opcode.byte));
                                                                                
                                                                                                
                                                                                                this.stack.setLocalSymbol(
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 5 hrs to fix
                                                                                src/SmaliVM.js on lines 3082..3110

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

                                                                                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(this.isImm(regV)){
                                                                                //                                this.setSymbol(regX, regX.add(regV.getValue(), oper.opcode.byte));
                                                                                
                                                                                                            
                                                                                                            this.stack.setLocalSymbol(
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 5 hrs to fix
                                                                                src/SmaliVM.js on lines 1960..1988

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

                                                                                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(regX.hasCode()){
                                                                                                                this.stack.setLocalSymbol(
                                                                                                                    regV, 
                                                                                                                    DTYPE.IMM_NUMERIC,
                                                                                                                    null,
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 4 hrs to fix
                                                                                src/SmaliVM.js on lines 1996..2009

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

                                                                                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(regX.hasCode()){
                                                                                                    this.stack.setLocalSymbol(
                                                                                                        regV, 
                                                                                                        DTYPE.IMM_NUMERIC,
                                                                                                        null,
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 4 hrs to fix
                                                                                src/SmaliVM.js on lines 3118..3131

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

                                                                                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)){
                                                                                                            if(regX.hasCode()){
                                                                                                                this.stack.setLocalSymbol(
                                                                                                                    regV, 
                                                                                                                    DTYPE.IMM_NUMERIC,
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 4 hrs to fix
                                                                                src/SmaliVM.js on lines 1995..2019

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

                                                                                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)){
                                                                                                if(regX.hasCode()){
                                                                                                    this.stack.setLocalSymbol(
                                                                                                        regV, 
                                                                                                        DTYPE.IMM_NUMERIC,
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 4 hrs to fix
                                                                                src/SmaliVM.js on lines 3117..3141

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

                                                                                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)){
                                                                                                        // TRUE case
                                                                                                        if(regV.getValue() !== null){
                                                                                                            v = `// ${regX}=${this.getImmediateValue(regV)} is not null, so "if(${regX} != 0)" was TRUE. Continue ...`;
                                                                                                        }
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 4163..4202

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

                                                                                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)){
                                                                                                        // FALSE case
                                                                                                        if(regV.getValue() !== null){
                                                                                                            v = `// ${regX}=${this.getImmediateValue(regV)} is not null, so "if(${regX} == 0)" was FALSE. Continue ...`;
                                                                                                        }
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 4223..4255

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

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

                                                                                    shl(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.SHL_LONG_2ADDR.byte:
                                                                                            case OPCODE.SHL_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) << pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 5 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 382..393
                                                                                src/SmaliVM.js on lines 396..407
                                                                                src/SmaliVM.js on lines 410..421
                                                                                src/SmaliVM.js on lines 438..449
                                                                                src/SmaliVM.js on lines 452..463

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

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

                                                                                    xor(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.XOR_LONG_2ADDR.byte:
                                                                                            case OPCODE.XOR_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) ^ pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 5 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 382..393
                                                                                src/SmaliVM.js on lines 396..407
                                                                                src/SmaliVM.js on lines 424..435
                                                                                src/SmaliVM.js on lines 438..449
                                                                                src/SmaliVM.js on lines 452..463

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

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

                                                                                    ushr(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.USHR_LONG_2ADDR.byte:
                                                                                            case OPCODE.USHR_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) >>> pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 5 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 382..393
                                                                                src/SmaliVM.js on lines 396..407
                                                                                src/SmaliVM.js on lines 410..421
                                                                                src/SmaliVM.js on lines 424..435
                                                                                src/SmaliVM.js on lines 438..449

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

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

                                                                                    shr(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.SHR_LONG_2ADDR.byte:
                                                                                            case OPCODE.SHR_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) >> pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 5 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 382..393
                                                                                src/SmaliVM.js on lines 396..407
                                                                                src/SmaliVM.js on lines 410..421
                                                                                src/SmaliVM.js on lines 424..435
                                                                                src/SmaliVM.js on lines 452..463

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

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

                                                                                    and(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.AND_LONG_2ADDR.byte:
                                                                                            case OPCODE.AND_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) & pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 5 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 396..407
                                                                                src/SmaliVM.js on lines 410..421
                                                                                src/SmaliVM.js on lines 424..435
                                                                                src/SmaliVM.js on lines 438..449
                                                                                src/SmaliVM.js on lines 452..463

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

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

                                                                                    or(pValue, pType, pOption=null){
                                                                                        switch(pType){
                                                                                            case OPCODE.OR_LONG_2ADDR.byte:
                                                                                            case OPCODE.OR_LONG.byte:
                                                                                                return ((this.value << 32) | (pOption & 0x00000000FFFFFFFF)) | pValue;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 5 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 382..393
                                                                                src/SmaliVM.js on lines 410..421
                                                                                src/SmaliVM.js on lines 424..435
                                                                                src/SmaliVM.js on lines 438..449
                                                                                src/SmaliVM.js on lines 452..463

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

                                                                                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.INT_TO_CHAR.byte:
                                                                                                
                                                                                                regX = this.getRegisterName(oper.right);
                                                                                                regV = this.stack.getLocalSymbol(regX);
                                                                                                v = null;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 3308..3321
                                                                                src/SmaliVM.js on lines 3352..3365

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

                                                                                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.INT_TO_SHORT.byte:
                                                                                                
                                                                                                regX = this.getRegisterName(oper.right);
                                                                                                regV = this.stack.getLocalSymbol(regX);
                                                                                                v = null;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 3308..3321
                                                                                src/SmaliVM.js on lines 3323..3336

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

                                                                                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.INT_TO_BYTE.byte:
                                                                                                
                                                                                                regX = this.getRegisterName(oper.right);
                                                                                                regV = this.stack.getLocalSymbol(regX);
                                                                                                v = null;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 2 other locations - About 3 hrs to fix
                                                                                src/SmaliVM.js on lines 3323..3336
                                                                                src/SmaliVM.js on lines 3352..3365

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

                                                                                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

                                                                                        src2 = { 
                                                                                            m: this.stack.getLocalSymbol( this.getRegisterName({ t:pSrc2.t, i:pSrc2.i+1 })), 
                                                                                            l: this.stack.getLocalSymbol( this.getRegisterName({ t:pSrc2.t, i:pSrc2.i })),
                                                                                            v: null
                                                                                        };
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 2 hrs to fix
                                                                                src/SmaliVM.js on lines 1890..1894

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

                                                                                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

                                                                                        src1 = { 
                                                                                            m: this.stack.getLocalSymbol( this.getRegisterName({ t:pSrc1.t, i:pSrc1.i+1 })), 
                                                                                            l: this.stack.getLocalSymbol( this.getRegisterName({ t:pSrc1.t, i:pSrc1.i })),
                                                                                            v: null
                                                                                        };
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 2 hrs to fix
                                                                                src/SmaliVM.js on lines 1896..1900

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

                                                                                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

                                                                                                v = `${indent}${oper.right.enclosingClass.alias!=null?oper.right.enclosingClass.alias:oper.right.enclosingClass.name}.${oper.right.alias!=null?oper.right.alias:oper.right.name}( `;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 2 hrs to fix
                                                                                src/SmaliVM.js on lines 3589..3589

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

                                                                                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

                                                                                                v = `${indent}${oper.right.enclosingClass.alias!=null?oper.right.enclosingClass.alias:oper.right.enclosingClass.name}.${oper.right.alias!=null?oper.right.alias:oper.right.name}( `;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 2 hrs to fix
                                                                                src/SmaliVM.js on lines 3630..3630

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

                                                                                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.stack.setLocalSymbol(
                                                                                                                regV, 
                                                                                                                DTYPE.IMM_NUMERIC,
                                                                                                                regX[SYMBOL_OPE[oper.opcode.ope]](regV.getValue(), oper.opcode.byte),
                                                                                                                `${this.getImmediateValue(regX)}${oper.opcode.ope}${this.getImmediateValue(regV)}`);
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 2 hrs to fix
                                                                                src/SmaliVM.js on lines 1964..1968

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

                                                                                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.stack.setLocalSymbol(
                                                                                                    regV, 
                                                                                                    DTYPE.IMM_NUMERIC,
                                                                                                    regX[SYMBOL_OPE[oper.opcode.ope]](regV.getValue(), oper.opcode.byte),
                                                                                                    `${this.getImmediateValue(regX)}${oper.opcode.ope}${this.getImmediateValue(regV)}`);
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 2 hrs to fix
                                                                                src/SmaliVM.js on lines 3086..3090

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

                                                                                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

                                                                                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 3892..3896

                                                                                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

                                                                                                        v = `${regV.endsWith(".String")?"":"("+regV+")"} ${label}.${oper.right.alias!=null? oper.right.alias : oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                                                                                src/SmaliVM.js on lines 3699..3699

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

                                                                                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

                                                                                                        v = `${regV.endsWith(".String")?"":"("+regV+")"} ${label}.${oper.right.alias!=null? oper.right.alias : oper.right.name}`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                                                                                src/SmaliVM.js on lines 3702..3702

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

                                                                                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

                                                                                                    }else if(regV.type == DTYPE.OBJECT_REF){
                                                                                                        // TRUE case
                                                                                                        if(regV.getValue() instanceof VM_ClassInstance){
                                                                                
                                                                                                            v = `// ${regX}=(ClassInstance)${regV.getValue().parent.name} is not null, so "if(${regX} != 0)" was TRUE. Continue ...`;
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                                                                                src/SmaliVM.js on lines 4173..4202

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

                                                                                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

                                                                                                    }else if(regV.type == DTYPE.OBJECT_REF){
                                                                                                        console.log(regV);
                                                                                                        // FALSE case
                                                                                                        if(regV.getValue() instanceof VM_ClassInstance){
                                                                                
                                                                                
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                                                                                src/SmaliVM.js on lines 4233..4255

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

                                                                                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

                                                                                                        else if(label.hasCode()){
                                                                                                            state.code.push(`${indent}${v} = ${label.getCode()};`);
                                                                                                            Logger.debug(`${indent}${v} = ${label.getCode()};`);
                                                                                                        }
                                                                                                        else{
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                                                                                src/SmaliVM.js on lines 3846..3857

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

                                                                                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(label)){
                                                                                                            state.code.push(`${indent}${v} = ${label.getValue()};`);
                                                                                                            Logger.debug(`${indent}${v} = ${label.getValue()};`);
                                                                                                        }
                                                                                                        else if(label.hasCode()){
                                                                                Severity: Major
                                                                                Found in src/SmaliVM.js and 1 other location - About 1 hr to fix
                                                                                src/SmaliVM.js on lines 3850..3857

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

                                                                                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, 
                                                                                                        null, 
                                                                                                        `${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 3908..3912

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

                                                                                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, 
                                                                                                        null, 
                                                                                                        `${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 3900..3904

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

                                                                                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

                                                                                                        state.code.push(`${indent}if( ${this.getRegisterName(oper.left[0])} <= ${this.getRegisterName(oper.left[1])} ) ${label}`);
                                                                                Severity: Minor
                                                                                Found in src/SmaliVM.js and 1 other location - About 45 mins to fix
                                                                                src/SmaliVM.js on lines 4088..4088

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

                                                                                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

                                                                                                        state.code.push(`${indent}if( ${this.getRegisterName(oper.left[0])} <= ${this.getRegisterName(oper.left[1])} ) ${label}`);
                                                                                Severity: Minor
                                                                                Found in src/SmaliVM.js and 1 other location - About 45 mins to fix
                                                                                src/SmaliVM.js on lines 4145..4145

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

                                                                                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

                                                                                    constructor( pCode, pMessage){
                                                                                        super(pMessage);
                                                                                        // Ensure the name of this error is the same as the class name
                                                                                        this.name = this.constructor.name;
                                                                                        this.code = pCode;
                                                                                Severity: Minor
                                                                                Found in src/SmaliVM.js and 1 other location - About 35 mins to fix
                                                                                src/Errors.js on lines 5..11

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

                                                                                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

                                                                                        if(this.isImm(src2.m) && this.isImm(src2.l)){
                                                                                            src2.v = (src2.m << 32) & (src2.l & 0x00000000FFFFFFFF);
                                                                                        }
                                                                                Severity: Minor
                                                                                Found in src/SmaliVM.js and 2 other locations - About 35 mins to fix
                                                                                src/SmaliVM.js on lines 1872..1874
                                                                                src/SmaliVM.js on lines 1902..1904

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

                                                                                        if(this.isImm(src1.m) && this.isImm(src1.l)){
                                                                                            src1.v = (src1.m << 32) & (src1.l & 0x00000000FFFFFFFF);
                                                                                        }
                                                                                Severity: Minor
                                                                                Found in src/SmaliVM.js and 2 other locations - About 35 mins to fix
                                                                                src/SmaliVM.js on lines 1872..1874
                                                                                src/SmaliVM.js on lines 1906..1908

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

                                                                                        if(this.isImm(s.m) && this.isImm(s.l)){
                                                                                            s.v = (s.m << 32) & (s.l & 0x00000000FFFFFFFF);
                                                                                        }
                                                                                Severity: Minor
                                                                                Found in src/SmaliVM.js and 2 other locations - About 35 mins to fix
                                                                                src/SmaliVM.js on lines 1902..1904
                                                                                src/SmaliVM.js on lines 1906..1908

                                                                                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