FrenchYeti/dexcalibur

View on GitHub

Showing 948 of 948 total issues

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

        "field.alias.update": function(ctx, event){
            try{
                if(ctx.saveManager.isReady() && ctx.saveManager.isEnabled()){
                    ctx.saveManager.updateAlias(SaveManager.T_FIELD, event.field); 
                    ctx.saveManager.save();
Severity: Major
Found in inspectors/Saver/main.js and 2 other locations - About 4 hrs to fix
inspectors/Saver/main.js on lines 69..82
inspectors/Saver/main.js on lines 97..110

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

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

        "method.alias.update": function(ctx, event){
            try{
                if(ctx.saveManager.isReady() && ctx.saveManager.isEnabled()){
                    ctx.saveManager.updateAlias(SaveManager.T_METHOD, event.meth); 
                    ctx.saveManager.save();
Severity: Major
Found in inspectors/Saver/main.js and 2 other locations - About 4 hrs to fix
inspectors/Saver/main.js on lines 83..96
inspectors/Saver/main.js on lines 97..110

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

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

        "class.alias.update": function(ctx, event){
            try{
                if(ctx.saveManager.isReady() && ctx.saveManager.isEnabled()){
                    ctx.saveManager.updateAlias(SaveManager.T_CLASS, event.cls); 
                    ctx.saveManager.save();
Severity: Major
Found in inspectors/Saver/main.js and 2 other locations - About 4 hrs to fix
inspectors/Saver/main.js on lines 69..82
inspectors/Saver/main.js on lines 83..96

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

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

        "probe.enable": function(ctx, event){
            try{
                if(ctx.saveManager.isReady() && ctx.saveManager.isEnabled()){
                    ctx.saveManager.updateHookStatus(event.data.hook, true); 
                    ctx.saveManager.save();
Severity: Major
Found in inspectors/Saver/main.js and 1 other location - About 4 hrs to fix
inspectors/Saver/main.js on lines 153..166

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 145.

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

        "probe.disable": function(ctx, event){
            try{
                if(ctx.saveManager.isReady() && ctx.saveManager.isEnabled()){
                    ctx.saveManager.updateHookStatus(event.data.hook, false); 
                    ctx.saveManager.save();
Severity: Major
Found in inspectors/Saver/main.js and 1 other location - About 4 hrs to fix
inspectors/Saver/main.js on lines 139..152

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function analyzeBlocks has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    analyzeBlocks(pMethod){
        
        let blocks =  pMethod.getBasicBlocks();

        if(blocks.length == 0) return null;
Severity: Minor
Found in src/Decompiler.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

HookManager has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class HookManager
{
    /**
     * 
     * @param {*} pProject 
Severity: Minor
Found in src/HookManager.js - About 4 hrs to fix

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

      function restore(filepath){
          let src=null, db=[];
      
          // unzip file
          Process.exec("unzip "+filepath);
      Severity: Major
      Found in src/BackupManager.js - About 4 hrs to fix

        Function toJsonObject has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        Field.prototype.toJsonObject = function(fields=null,exclude=null){
            let obj = new Object();
            /*if(fields.length>0){
                for(let i in fields){
                    if(this[fields[i]] != null && (typeof this[fields[i]] == "object")){
        Severity: Minor
        Found in src/CoreClass.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 runSimplify has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            runSimplify(){
                let ssmali=[], dec=null, f=0, pDepth=0, d=null;
                let bbs = this.method.getBasicBlocks();
        
                for(let i=0; i<bbs.length; i++){
        Severity: Minor
        Found in src/Decompiler.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

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

                "probe.post_code_change": function(ctx, event){
                    try{
                        if(ctx.saveManager.isReady() && ctx.saveManager.isEnabled()){
                            ctx.saveManager.updateHook(event.data); 
                            ctx.saveManager.save();
        Severity: Major
        Found in inspectors/Saver/main.js and 1 other location - About 4 hrs to fix
        inspectors/Saver/main.js on lines 111..124

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

        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

                "probe.new": function(ctx, event){
                    try{
                        if(ctx.saveManager.isReady() && ctx.saveManager.isEnabled()){
                            ctx.saveManager.updateHook(event.data); 
                            ctx.saveManager.save();
        Severity: Major
        Found in inspectors/Saver/main.js and 1 other location - About 4 hrs to fix
        inspectors/Saver/main.js on lines 125..138

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

        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

                this.app.route('/api/manifest/provider/:id')
                    .get(function (req, res) {
                        let name = UT.decodeURI(UT.b64_decode(req.params.id));
                        let act = $.project.find.get.provider(name);
        
        
        Severity: Major
        Found in src/WebServer.js and 1 other location - About 4 hrs to fix
        src/WebServer.js on lines 1895..1905

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

        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

                this.app.route('/api/manifest/service/:id')
                    .get(function (req, res) {
                        let name = UT.decodeURI(UT.b64_decode(req.params.id));
                        let act = $.project.find.get.service(name);
        
        
        Severity: Major
        Found in src/WebServer.js and 1 other location - About 4 hrs to fix
        src/WebServer.js on lines 1873..1883

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

        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

            setAttributes(attr){
                let n="";
                for(let i in attr){
                    if(i.startsWith(ANDROID_PREFIX)){
                        n = i.substr(ANDROID_PREFIX_LEN);
        Severity: Major
        Found in src/AndroidAppComponents.js and 2 other locations - About 4 hrs to fix
        src/AndroidAppComponents.js on lines 92..104
        src/AndroidAppComponents.js on lines 860..872

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

        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

            setAttributes(attr){
                let n="";
                for(let i in attr){
                    if(i.startsWith(ANDROID_PREFIX)){
                        n = i.substr(ANDROID_PREFIX_LEN);
        Severity: Major
        Found in src/AndroidAppComponents.js and 2 other locations - About 4 hrs to fix
        src/AndroidAppComponents.js on lines 23..35
        src/AndroidAppComponents.js on lines 860..872

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

        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

            setAttributes(attr){
                let n="";
                for(let i in attr){
                    if(i.startsWith(ANDROID_PREFIX)){
                        n = i.substr(ANDROID_PREFIX_LEN);
        Severity: Major
        Found in src/AndroidAppComponents.js and 2 other locations - About 4 hrs to fix
        src/AndroidAppComponents.js on lines 23..35
        src/AndroidAppComponents.js on lines 92..104

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 138.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        File DeviceManager.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const _path_ = require("path");
        const _fs_ = require("fs");
        const _os_ = require('os');
        
        var ut = require("./Utils.js");
        Severity: Minor
        Found in src/DeviceManager.js - About 4 hrs to fix

          File SaveManager.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const _fs_ = require("fs");
          const _path_ = require("path");
          
          const Logger = require('../../src/Logger.js')(); 
          const DB = require('../../connectors/inmemory/InMemoryDb.js');
          Severity: Minor
          Found in inspectors/Saver/SaveManager.js - About 4 hrs to fix
            Severity
            Category
            Status
            Source
            Language