FrenchYeti/dexcalibur

View on GitHub
inspectors/DynamicLoader/main.js

Summary

Maintainability
D
1 day
Test Coverage

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

const Fs = require("fs");
const Path = require("path")

const HOOK = require("../../src/HookManager.js");
const CLASS = require("../../src/CoreClass.js");
Severity: Minor
Found in inspectors/DynamicLoader/main.js - About 5 hrs to fix

    Function dxc.fullscan.post_deploy has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            "dxc.fullscan.post_deploy": function (ctx, event) {
                Logger.info("[INSPECTOR][TASK] Trying to restore previous data of DynLoaderInspector ... ");
                let currentInspector = ctx.getInspector("DynamicLoader");
    
                currentInspector.restore();
    Severity: Major
    Found in inspectors/DynamicLoader/main.js - About 2 hrs to fix

      Function hook.dex.classloader.new has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              "hook.dex.classloader.new": function (ctx, event) {
                  // 1. save gathered bytecode to a file
                  // 2. disassemble this file 
                  // 3. Analyze & update graph
                  // 4. Workspace cleanup
      Severity: Major
      Found in inspectors/DynamicLoader/main.js - About 2 hrs to fix

        Function hook.reflect.method.get has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

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

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

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

          There are no issues that match your filters.

          Category
          Status