etz69/irhelper

View on GitHub

Showing 58 of 165 total issues

Function samparse has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
Open

def samparse(samhive):

    results = OrderedDict()
    results['users'] = OrderedDict()

Severity: Minor
Found in modules/utils/samparser.py - 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 vol_malfind_extended has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

def vol_malfind_extended(_project):
    global result

    print_header("Running malfind_extended command")

Severity: Minor
Found in modules/cmds/vol_malfind_extended_module.py - About 1 day 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 helper.py has 526 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import sys
import hashlib
import jellyfish
import math
import ipaddress
Severity: Major
Found in modules/utils/helper.py - About 1 day to fix

Function normalize_network_info has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

def normalize_network_info(_project):

    print_header("Network data normalization")
    global result
    _table = ""
Severity: Minor
Found in modules/cmds/vol_netscan_module.py - About 1 day 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 vol_pslist has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

def vol_pslist(_project):
    global result

    print_header("Executing vol_pslist...")
    rdb = dbops.DBOps(_project.db_name)
Severity: Minor
Found in modules/cmds/vol_pslist_module.py - About 7 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 analyse_processes has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

def analyse_processes(_project):
    '''
    This module will check all running processes to verify that the correct
    parent process has spawned the running one.
    Some ideas like the rules format has been taken from DAMM - @ 504ENSICS Labs
Severity: Minor
Found in modules/cmds/vol_pslist_module.py - About 7 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 calculate_risk has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

def calculate_risk(risk_index, process_info, plist, risk_level):
    list_of_suspicious_processes = list()
    suspicious_process = dict()

    rdict = dict()
Severity: Minor
Found in modules/utils/helper.py - 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

File vol_pslist_module.py has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import collections
import json
import sys

sys.path.append(sys.path[0]+"/../../")
Severity: Minor
Found in modules/cmds/vol_pslist_module.py - About 5 hrs to fix

Function main has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    if os.geteuid() == 0:
        exit("You must not run this code with root privileges")

    if args.debug:
Severity: Minor
Found in irhelper.py - About 5 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 analyse_scan_processes has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def analyse_scan_processes(_project):

    ## First we retrieve psxview all processes
    global result
    print_header("Gathering information from scan process")
Severity: Minor
Found in modules/cmds/vol_pslist_module.py - 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 load_tree_test has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function load_tree_test(){
    var margin = {top: 20, right: 120, bottom: 20, left: 120},
    width = 960 - margin.right - margin.left,
    height = 800 - margin.top - margin.bottom;

Severity: Major
Found in templates/irfunctions.js - About 4 hrs to fix

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

def main(file,output):
#    parser = argparse.ArgumentParser()
#    parser.add_argument("SAM", help="SAM Windows registry hive to parse")

#    parser.add_argument("-o", '--out', nargs='?', help="Output")
Severity: Minor
Found in modules/utils/samparser.py - 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

Function get_cifapp_info has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def get_cifapp_info(data):

    session = requests.Session()
    indicators = list()
    config = ConfigParser.ConfigParser()
Severity: Minor
Found in modules/utils/helper.py - 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

Function render_text has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def render_text(self, outfd, data):
        outfd.write('\t'.join(h for h in ['Date/Time (UTC)', 'Type', 'Summary', 'Source']) + '\n')
        for result in data:
            if result.get('timestamp'):
                row = '\t'.join('{0}'.format(x) for x in [result.get('timestamp'),
Severity: Minor
Found in vol_plugins/system_info.py - 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

Function main has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def main():
    if os.geteuid() == 0:
        exit("You must not run this code with root privileges")

    if args.debug:
Severity: Major
Found in irhelper.py - About 2 hrs to fix

Function parse_output has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_output(self, data):
        ##dirty data extraction routine. Sqlite output is broken
        results = list()
        pinfo_hollow = dict()

Severity: Minor
Found in modules/utils/helper.py - 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 check_hash_vt has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def check_hash_vt(risk_list, check):

    enhanced_risk_list = list()

    if not check:
Severity: Minor
Found in modules/utils/helper.py - 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 calculate has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def calculate(self):
        if self._config.PID:
            filter_pid = self._config.PID
            # This is so that when -p option is given it can still enumerate all processes to determine similar processes
            self._config.PID = None
Severity: Minor
Found in vol_plugins/hollowfind.py - 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 execute_volatility_plugin has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def execute_volatility_plugin(plugin_type, plugin_name,
                              output, project, result,
                              shell, dump, plugin_parms, **kwargs):

    #result = {'status': True, 'message': '', 'cmd_results': '', 'errors': []}
Severity: Minor
Found in modules/utils/helper.py - 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 update has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function update(source) {

  // Compute the new tree layout.
  var nodes = tree.nodes(root).reverse(),
      links = tree.links(nodes);
Severity: Major
Found in templates/irfunctions.js - About 2 hrs to fix
Severity
Category
Status
Source
Language