hackedteam/vector-offline2

View on GitHub

Showing 176 of 176 total issues

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

                if self.tablin['osversion'] != "":
                    output += ' ' + self.tablin['osversion']
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 1 hr to fix
offline-linux/offline-install/offline_gui.py on lines 1438..1439
offline-linux/offline-install/offline_gui.py on lines 1441..1442
offline-linux/offline-install/offline_gui.py on lines 1502..1503

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

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 os.path.exists("/mnt/RCSPE/files/OSX/") == False:
                            self.staosx = False
                            self.licosx = False

                            print("  Not found: OS X license")
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 1 other location - About 1 hr to fix
offline-linux/offline-install/offline_gui.py on lines 1034..1040

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

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

                if self.tablin['osversion'] != "":
                    osentry += ' ' + self.tablin['osversion']
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 1 hr to fix
offline-linux/offline-install/offline_gui.py on lines 1441..1442
offline-linux/offline-install/offline_gui.py on lines 1499..1500
offline-linux/offline-install/offline_gui.py on lines 1502..1503

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

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

                if self.tablin['oscode'] != "":
                    output += ' ' + self.tablin['oscode']
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 1 hr to fix
offline-linux/offline-install/offline_gui.py on lines 1438..1439
offline-linux/offline-install/offline_gui.py on lines 1441..1442
offline-linux/offline-install/offline_gui.py on lines 1499..1500

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

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 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 and 1 other location - About 1 hr to fix
offline-linux/offline-install/offline_gui.py on lines 1026..1032

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

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

                if self.tablin['oscode'] != "":
                    osentry += ' ' + self.tablin['oscode']
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 1 hr to fix
offline-linux/offline-install/offline_gui.py on lines 1438..1439
offline-linux/offline-install/offline_gui.py on lines 1499..1500
offline-linux/offline-install/offline_gui.py on lines 1502..1503

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

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

        scrambled_path2 += ".reports-" + str(uid) + "-" + self.backconf['hdir']
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 2 other locations - About 55 mins to fix
offline-linux/offline-install/offline_gui.py on lines 1902..1902
offline-linux/offline-install/offline_gui.py on lines 2971..2971

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

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

        backdoor_path = "/mnt" + home + "/Library/Preferences/" + self.backconf['hdir'] + "_"
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 55 mins to fix
offline-linux/offline-install/offline_gui.py on lines 485..486
offline-linux/offline-install/offline_gui.py on lines 487..488
offline-linux/offline-install/offline_gui.py on lines 2443..2446

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

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

            if os.path.exists("/mnt/Users/" + i + "/Library/Preferences/" + self.backconf['hdir'] + "/8qDfADd3.ivd") == True:
                hpath = "/mnt/Users/" + i + "/Library/Preferences/" + self.backconf['hdir'] + "/8qDfADd3.ivd"
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 55 mins to fix
offline-linux/offline-install/offline_gui.py on lines 487..488
offline-linux/offline-install/offline_gui.py on lines 2205..2205
offline-linux/offline-install/offline_gui.py on lines 2443..2446

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

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

            elif os.path.exists("/mnt/Users/" + i + "/Library/Preferences/" + self.backconf['hdir'] + ".app/8qDfADd3.ivd") == True:
                                hpath = "/mnt/Users/" + i + "/Library/Preferences/" + self.backconf['hdir'] + ".app/8qDfADd3.ivd"
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 55 mins to fix
offline-linux/offline-install/offline_gui.py on lines 485..486
offline-linux/offline-install/offline_gui.py on lines 2205..2205
offline-linux/offline-install/offline_gui.py on lines 2443..2446

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

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

        if self.tablin['homedisk'] != None:
            backdoor_path = "/mnt2" + home[5:] + "/.config/autostart/.whoopsie-" + self.backconf['hdir'] + ".desktop"
        else:
            backdoor_path = "/mnt" + home + "/.config/autostart/.whoopsie-" + self.backconf['hdir'] + ".desktop"
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 3 other locations - About 55 mins to fix
offline-linux/offline-install/offline_gui.py on lines 485..486
offline-linux/offline-install/offline_gui.py on lines 487..488
offline-linux/offline-install/offline_gui.py on lines 2205..2205

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

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

        the_backdoor_path += ".reports-" + str(uid) + "-" + self.backconf['hdir']
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 2 other locations - About 55 mins to fix
offline-linux/offline-install/offline_gui.py on lines 2971..2971
offline-linux/offline-install/offline_gui.py on lines 2972..2972

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

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

        scrambled_path1 += ".reports-" + str(uid) + "-" + self.backconf['hdir']
Severity: Major
Found in offline-linux/offline-install/offline_gui.py and 2 other locations - About 55 mins to fix
offline-linux/offline-install/offline_gui.py on lines 1902..1902
offline-linux/offline-install/offline_gui.py on lines 2972..2972

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

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

Avoid deeply nested control flow statements.
Open

                        if os.path.exists("/mnt/RCSPE/files/OSX/") == False:
                            self.staosx = False
                            self.licosx = False

                            print("  Not found: OS X license")
Severity: Major
Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            for line in open("/mnt/RCSPE/RCS.ini").readlines():
                                if line.find("[RCS]") != -1:
                                    continue
    
                                line = line.replace("\n", "").split("=")
    Severity: Major
    Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if len(j) > 3:
                                  try:
                                      ret = subprocess.call("cryptsetup isLuks /dev/{}".format(j), shell=True)
                                      if int(ret) == 0:
                                          if svalue == 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 subprocess.check_output("ls -l /mnt/home/ | grep '{}' | grep -i '^d' | wc -l".format(line[0]), shell=True).decode('utf-8')[:-1] == '0':
                                    break
                            else:
        Severity: Major
        Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for i in keys:
                                      if (i in self.backconf) == False:
                                          print("  Not found: " + i + " in configuration file") 
                                          self.backconf = None 
                                          break
          Severity: Major
          Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if self.backconf != None:
                                        if ('holddir' in self.backconf) == True:
                                            self.backconf.update({'holddir': self.backconf['hdir']})
            
                                        if ('holdreg' in self.backconf) == True:
            Severity: Major
            Found in offline-linux/offline-install/offline_gui.py - About 45 mins to fix

              Function check_devices has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def check_devices(self):
                      devs = os.listdir('/dev/')
                      hds = []
              
                      print("Searching hd devices...")
              Severity: Minor
              Found in offline-linux/offline-install/offline_gui.py - About 45 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

              Severity
              Category
              Status
              Source
              Language