hackedteam/vector-offline2

View on GitHub

Showing 64 of 176 total issues

File offline_gui.py has 2533 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python3
#

from gi.repository import Gtk, GObject
import subprocess
Severity: Major
Found in offline-linux/offline-install/offline_gui.py - About 1 wk to fix

    Function install_linux_backdoor has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
    Open

        def install_linux_backdoor(self, user):
            print("    Try to install the backdoor for " + user + " on Linux system...")
    
            try:
                ret = subprocess.check_output("mount -t {} /dev/{} /mnt/ 2> /dev/null".format(self.tablin['rootfs'], self.tablin['rootdisk']), shell=True)
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 export_linux_logs has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

        def export_linux_logs(self, user):
            print("    Try to export logs for " + user + " on Linux system...")
            
            [hex_high_dt, hex_low_dt] = self.ts_unix2win()
    
    
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 uninstall_linux_backdoor has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
    Open

        def uninstall_linux_backdoor(self, user):
            print("    Try to uninstall the backdoor for " + user + " on Linux system...")
    
            try:
                ret = subprocess.check_output("mount -t {} /dev/{} /mnt/ 2> /dev/null".format(self.tablin['rootfs'], self.tablin['rootdisk']), shell=True)
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 check_configfiles has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_configfiles(self):
            devs = os.listdir('/dev/')
    
            print("Searching configuration files in the devices...")
    
    
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 check_linux_config has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_linux_config(self):
            osproduct = "Linux"
            osversion = ""
            oscode = ""
            osname = ""
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 check_status_linux_users has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_status_linux_users(self):
            print("  Check status of Linux users...")
    
            try:
                ret = subprocess.check_output("mount -t {} /dev/{} /mnt 2> /dev/null".format(self.tablin['rootfs'], self.tablin['rootdisk']), shell=True)
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 check_partitions has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_partitions(self, svalue):
            devs, hds = self.check_devices()
            parts = []
    
            if hds == None:
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 check_mount has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_mount(self):
            tablefs = self.check_filesystems()
            tablemount = []
    
            if tablefs == None:
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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 select_os has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        def select_os(self, *args):
            if str(self.builder.get_object("comboboxtext1").get_active_text()).find("Mac OS X") != -1:
                self.builder.get_object("liststore1").clear()
    
                if self.staosx == True and self.exsosx == True:
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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

    Function export_osx_logs has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

        def export_osx_logs(self, user):
            print("    Try to export logs for " + user + " on Mac OS X system...")
            
            [hex_high_dt, hex_low_dt] = self.ts_unix2win()
    
    
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.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

    OfflineInstall has 44 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class OfflineInstall(object):
        builder = None
        liststore = None
        window = None
        scroll = None
    Severity: Minor
    Found in offline-linux/offline-install/offline_gui.py - About 6 hrs to fix

      Function check_osx_users has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_osx_users(self):
              self.useosx = []
      
              print("    Check OS X system users...")
      
      
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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 check_filesystems has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_filesystems(self):
              parts = self.check_partitions(True)
              fs = ['hfsplus', 'ext4', 'reiserfs', 'ext3', 'ext2', 'xfs', 'jfs', 'btrfs', 'ufsd']
              tablefs = []
          
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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 mount_devs has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def mount_devs(self):
              parts = self.check_partitions(False)
              fs = ['vfat', 'ntfs-3g', 'msdos', 'hfsplus', 'ext4', 'reiserfs', 'ext3', 'ext2', 'xfs', 'jfs', 'btrfs', 'ufsd']
      
              print("Check drives on partitions to mount...")
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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 install_osx_backdoor has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          def install_osx_backdoor(self, user):
              print("    Try to install the backdoor for " + user + " on Mac OS X system...")
      
              try:
                  ret = subprocess.check_output("mount -t {} -o force /dev/{} /mnt/ 2> /dev/null".format(self.tabosx['rootfsrw'], self.tabosx['rootdisk']), shell=True)
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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 check_status_osx_users has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_status_osx_users(self):
              print("  Check status of OS X users...")    
      
              try:
                  ret = subprocess.check_output("mount -t {} /dev/{} /mnt/ 2> /dev/null".format(self.tabosx['rootfs'], self.tabosx['rootdisk']), shell=True)
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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 export_logs has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          def export_logs(self, *args):
              print("Export logs action...")
      
              model, rows = self.builder.get_object("treeview-selection1").get_selected_rows()
      
      
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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 check_linux_users has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def check_linux_users(self):
              self.uselin = []
              user = []
      
              print("    Check Linux system users...")
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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 uninstall_osx_backdoor has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def uninstall_osx_backdoor(self, user):
              print("    Try to uninstall the backdoor for " + user + " on Mac OS X system...")
      
              try:
                  ret = subprocess.check_output("mount -t {} -o force /dev/{} /mnt/ 2> /dev/null".format(self.tabosx['rootfsrw'], self.tabosx['rootdisk']), shell=True)
      Severity: Minor
      Found in offline-linux/offline-install/offline_gui.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

      Severity
      Category
      Status
      Source
      Language