hackedteam/vector-offline2

View on GitHub

Showing 176 of 176 total issues

Avoid deeply nested control flow statements.
Open

                            if len(mountpoint) != 0:
                                print("  Found: " + j[0] + " -> /dev/" + j[1] + " -> " + j[2] + " -> " + uuid_sup + ' -> ' + mountpoint)
                                self.exslin = True
                                tablemount.append([j[0], j[1], j[2], mountpoint])

Severity: Major
Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if os.path.exists("/mnt/RCSPE/files/LINUX/") == False:
                                self.stalin = False
                                self.liclin = False
    
                                print("  Not found: Linux license")
    Severity: Major
    Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if svalue == True:
                                      self.crylin = True
      
      
      Severity: Major
      Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if ret != 0:
                                        uuid_sup = "UUID"
                                        uuid = subprocess.check_output("blkid | grep -i '{}' | awk '{{print $2}}'".format(j[1]), shell=True)[6:-2].decode('utf-8')
                                        mountpoint = subprocess.check_output("cat /mnt/etc/fstab 2> /dev/null | grep -v '#' | grep -i {} | egrep ' / | /home | /var ' | awk '{{print $2}}'".format(uuid), shell=True)[:-1].decode('utf-8')
        
        
        Severity: Major
        Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if subprocess.check_output("ls -l /mnt2/ | grep '{}' | grep -i '^d' | wc -l".format(line[0]), shell=True).decode('utf-8')[:-1] == '0':
                                      break
          
          
          Severity: Major
          Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

            Consider simplifying this complex logical expression.
            Open

                        if is_dir == False and is_temp_dir == False:
                            print("        " + i['username'] + " status is: not infected") 
                            i['status'] = None 
                        elif is_temp_file1 == True and is_temp_file2 == True and is_dir == False:
                            print("        " + i['username'] + " status is: infected")
            Severity: Major
            Found in offline-linux/offline-install/offline_gui.py - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if osversion.find("10.5") != -1 or osversion.find("10.6") != -1 or osversion.find("10.7") != -1 or osversion.find("10.8") != -1 or osversion.find("10.9") != -1 or osversion.find("10.10") != -1:
                          ossupport = True
              
              
              Severity: Major
              Found in offline-linux/offline-install/offline_gui.py - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                            if i[0] == 'linux' and i[3] == '/':
                                tablelinux.update({'rootdisk': i[1]})
                                tablelinux.update({'rootfs': i[2]})
                                tablelinux.update({'rootmount': i[3]})
                            elif i[0] == 'linux' and i[3] == ('/home' or '/home/'):
                Severity: Major
                Found in offline-linux/offline-install/offline_gui.py - About 40 mins to fix

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

                              elif is_temp_file1 == True and is_temp_file2 == True and is_dir == False:
                                  print("        " + i['username'] + " status is: infected")
                                  i['status'] = True
                  Severity: Major
                  Found in offline-linux/offline-install/offline_gui.py and 4 other locations - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 1171..1173
                  offline-linux/offline-install/offline_gui.py on lines 1177..1179
                  offline-linux/offline-install/offline_gui.py on lines 1321..1323
                  offline-linux/offline-install/offline_gui.py on lines 1324..1326

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

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

                      def check_ossystems(self):
                          tablemount = self.check_mount()
                          tableosx = {}
                          tablelinux = {}
                  
                  
                  Severity: Minor
                  Found in offline-linux/offline-install/offline_gui.py - 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

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

                                              print("  Found: " + opsy + " -> /dev/" + i + " -> " + j)
                  Severity: Minor
                  Found in offline-linux/offline-install/offline_gui.py and 1 other location - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 268..268

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

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

                              elif is_dir == True and is_file1 == True and is_file2 == True and is_file3 == True:
                                  print("        " + i['username'] + " status is: infected")
                                  i['status'] = True
                  Severity: Major
                  Found in offline-linux/offline-install/offline_gui.py and 4 other locations - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 1171..1173
                  offline-linux/offline-install/offline_gui.py on lines 1174..1176
                  offline-linux/offline-install/offline_gui.py on lines 1177..1179
                  offline-linux/offline-install/offline_gui.py on lines 1321..1323

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

                  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 self.tablin != None:
                              if self.check_linux_config() == False:
                                  self.tablin = None
                  Severity: Minor
                  Found in offline-linux/offline-install/offline_gui.py and 1 other location - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 948..950

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

                  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

                                          print("  Found: " + opsy + " -> /dev/" + i + " -> " + j)                
                  Severity: Minor
                  Found in offline-linux/offline-install/offline_gui.py and 1 other location - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 265..265

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

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

                              if is_dir == False and is_file3 == False:
                                  print("        " + i['username'] + " status is: not infected")
                                  i['status'] = None
                  Severity: Major
                  Found in offline-linux/offline-install/offline_gui.py and 4 other locations - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 1171..1173
                  offline-linux/offline-install/offline_gui.py on lines 1174..1176
                  offline-linux/offline-install/offline_gui.py on lines 1177..1179
                  offline-linux/offline-install/offline_gui.py on lines 1324..1326

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

                  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 self.tabosx != None:
                              if self.check_osx_config() == False:
                                  self.tabosx = None
                  Severity: Minor
                  Found in offline-linux/offline-install/offline_gui.py and 1 other location - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 952..954

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

                  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

                          try:
                              name = subprocess.check_output("awk -F'<|>' '/ProductName/ {getline; print$3}' /mnt/System/Library/CoreServices/SystemVersion.plist", shell=True)[:-1].decode('utf-8')
                              osproduct = name
                  Severity: Minor
                  Found in offline-linux/offline-install/offline_gui.py and 1 other location - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 562..564

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

                  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

                          try:
                              version = subprocess.check_output("awk -F'<|>' '/ProductVersion/ {getline; print$3}' /mnt/System/Library/CoreServices/SystemVersion.plist", shell=True)[:-1].decode('utf-8')
                              osversion = version
                  Severity: Minor
                  Found in offline-linux/offline-install/offline_gui.py and 1 other location - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 554..556

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

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

                              if is_dir == False and is_temp_dir == False:
                                  print("        " + i['username'] + " status is: not infected") 
                                  i['status'] = None 
                  Severity: Major
                  Found in offline-linux/offline-install/offline_gui.py and 4 other locations - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 1174..1176
                  offline-linux/offline-install/offline_gui.py on lines 1177..1179
                  offline-linux/offline-install/offline_gui.py on lines 1321..1323
                  offline-linux/offline-install/offline_gui.py on lines 1324..1326

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

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

                              elif is_file1 == True and is_file2 == True and is_temp_dir == False:
                                  print("        " + i['username'] + " status is: infected")
                                  i['status'] = True 
                  Severity: Major
                  Found in offline-linux/offline-install/offline_gui.py and 4 other locations - About 35 mins to fix
                  offline-linux/offline-install/offline_gui.py on lines 1171..1173
                  offline-linux/offline-install/offline_gui.py on lines 1174..1176
                  offline-linux/offline-install/offline_gui.py on lines 1321..1323
                  offline-linux/offline-install/offline_gui.py on lines 1324..1326

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language