byt3bl33d3r/MITMf

View on GitHub
plugins/filepwn.py

Summary

Maintainability
F
1 wk
Test Coverage

File filepwn.py has 486 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python2.7

# Copyright (c) 2014-2016 Marcello Salvati
#
# This program is free software; you can redistribute it and/or
Severity: Minor
Found in plugins/filepwn.py - About 7 hrs to fix

    Function binaryGrinder has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def binaryGrinder(self, binaryFile):
            """
            Feed potential binaries into this function,
            it will return the result PatchedBinary, False, or None
            """
    Severity: Minor
    Found in plugins/filepwn.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 response has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def response(self, response, request, data):
    
            content_header = response.responseHeaders.getRawHeaders('Content-Type')[0]
            client_ip      = request.client.getClientIP()
            host           = request.headers['host']
    Severity: Minor
    Found in plugins/filepwn.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 inject_zip has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def inject_zip(self, aZipFile):
            # When called will unpack and edit a Zip File and return a zip file
            tmp_file = tempfile.NamedTemporaryFile()
            tmp_file.write(aZipFile)
            tmp_file.seek(0)
    Severity: Minor
    Found in plugins/filepwn.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 inject_tar has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def inject_tar(self, aTarFileBytes, formatt=None):
            # When called will unpack and edit a Tar File and return a tar file"
    
            tmp_file = tempfile.NamedTemporaryFile()
            tmp_file.write(aTarFileBytes)
    Severity: Minor
    Found in plugins/filepwn.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 parse_target_config has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_target_config(self, targetConfig):
            for key, value in targetConfig.items():
                if hasattr(self, key) is False:
                    setattr(self, key, value)
                    self.log.debug("Settings Config {0}: {1}".format(key, value))
    Severity: Minor
    Found in plugins/filepwn.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function keys_whitelist_check has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def keys_whitelist_check(self, req_url, req_host):
            # Host whitelist check takes precedence
            if self.patchIT is False:
                return None
    
    
    Severity: Minor
    Found in plugins/filepwn.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function hosts_whitelist_check has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def hosts_whitelist_check(self, req_host):
            if self.host_whitelist.lower() == 'all':
                self.patchIT = True
    
            elif type(self.host_whitelist) is str:
    Severity: Minor
    Found in plugins/filepwn.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function hosts_blacklist_check has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def hosts_blacklist_check(self, req_host):
            if type(self.host_blacklist) is str:
                if self.host_blacklist.lower() in req_host.lower():
                    self.patchIT = False
                    self.log.info("Host Blacklist hit: {0} : HOST: {1} ".format(self.host_blacklist, req_host))
    Severity: Minor
    Found in plugins/filepwn.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function keys_backlist_check has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def keys_backlist_check(self, req_url, req_host):
            if type(self.keys_blacklist) is str:
                if self.keys_blacklist.lower() in req_url.lower():
                    self.patchIT = False
                    self.log.info("Keyword blacklist hit: {0}, PATH: {1}".format(self.keys_blacklist, req_url))
    Severity: Minor
    Found in plugins/filepwn.py - About 55 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

    Avoid deeply nested control flow statements.
    Open

                            with open(file2, 'rb') as f:
                                new_tar_file.addfile(info, f)
                            os.remove(file2)
    Severity: Major
    Found in plugins/filepwn.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              with open(tmp.name, 'rb') as f:
                                  new_tar_file.addfile(info, f)
      
              # finalize the writing of the tar file first
              new_tar_file.close()
      Severity: Major
      Found in plugins/filepwn.py - About 45 mins to fix

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

                if self.keys_whitelist.lower() == 'all':
                    self.patchIT = True
                elif type(self.keys_whitelist) is str:
                    if self.keys_whitelist.lower() in req_url.lower():
                        self.patchIT = True
        Severity: Major
        Found in plugins/filepwn.py and 1 other location - About 1 day to fix
        plugins/filepwn.py on lines 578..591

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

        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

            def hosts_blacklist_check(self, req_host):
                if type(self.host_blacklist) is str:
                    if self.host_blacklist.lower() in req_host.lower():
                        self.patchIT = False
                        self.log.info("Host Blacklist hit: {0} : HOST: {1} ".format(self.host_blacklist, req_host))
        Severity: Major
        Found in plugins/filepwn.py and 1 other location - About 1 day to fix
        plugins/filepwn.py on lines 550..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 174.

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

                        if targetFile.class_type == 0x1:
                            # x86CPU Type
                            targetFile = elfbin.elfbin(FILE=binaryFile,
                                                       OUTPUT=os.path.basename(binaryFile),
                                                       SHELL=self.LinuxIntelx86['SHELL'],
        Severity: Major
        Found in plugins/filepwn.py and 5 other locations - About 5 hrs to fix
        plugins/filepwn.py on lines 438..448
        plugins/filepwn.py on lines 457..466
        plugins/filepwn.py on lines 468..477
        plugins/filepwn.py on lines 479..488
        plugins/filepwn.py on lines 490..499

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

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

                            elif self.FatPriority == 'x64':
                                targetFile = machobin.machobin(FILE=binaryFile,
                                                               OUTPUT=os.path.basename(binaryFile),
                                                               SHELL=self.MachoIntelx64['SHELL'],
                                                               HOST=self.MachoIntelx64['HOST'],
        Severity: Major
        Found in plugins/filepwn.py and 5 other locations - About 5 hrs to fix
        plugins/filepwn.py on lines 427..437
        plugins/filepwn.py on lines 438..448
        plugins/filepwn.py on lines 457..466
        plugins/filepwn.py on lines 479..488
        plugins/filepwn.py on lines 490..499

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

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

                            if self.FatPriority == 'x86':
                                targetFile = machobin.machobin(FILE=binaryFile,
                                                               OUTPUT=os.path.basename(binaryFile),
                                                               SHELL=self.MachoIntelx86['SHELL'],
                                                               HOST=self.MachoIntelx86['HOST'],
        Severity: Major
        Found in plugins/filepwn.py and 5 other locations - About 5 hrs to fix
        plugins/filepwn.py on lines 427..437
        plugins/filepwn.py on lines 438..448
        plugins/filepwn.py on lines 468..477
        plugins/filepwn.py on lines 479..488
        plugins/filepwn.py on lines 490..499

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

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

                        elif targetFile.mach_hdrs[0]['CPU Type'] == '0x7':
                            targetFile = machobin.machobin(FILE=binaryFile,
                                                           OUTPUT=os.path.basename(binaryFile),
                                                           SHELL=self.MachoIntelx86['SHELL'],
                                                           HOST=self.MachoIntelx86['HOST'],
        Severity: Major
        Found in plugins/filepwn.py and 5 other locations - About 5 hrs to fix
        plugins/filepwn.py on lines 427..437
        plugins/filepwn.py on lines 438..448
        plugins/filepwn.py on lines 457..466
        plugins/filepwn.py on lines 468..477
        plugins/filepwn.py on lines 490..499

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

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

                        elif targetFile.class_type == 0x2:
                            # x64
                            targetFile = elfbin.elfbin(FILE=binaryFile,
                                                       OUTPUT=os.path.basename(binaryFile),
                                                       SHELL=self.LinuxIntelx64['SHELL'],
        Severity: Major
        Found in plugins/filepwn.py and 5 other locations - About 5 hrs to fix
        plugins/filepwn.py on lines 427..437
        plugins/filepwn.py on lines 457..466
        plugins/filepwn.py on lines 468..477
        plugins/filepwn.py on lines 479..488
        plugins/filepwn.py on lines 490..499

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

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

                        elif targetFile.mach_hdrs[0]['CPU Type'] == '0x1000007':
                            targetFile = machobin.machobin(FILE=binaryFile,
                                                           OUTPUT=os.path.basename(binaryFile),
                                                           SHELL=self.MachoIntelx64['SHELL'],
                                                           HOST=self.MachoIntelx64['HOST'],
        Severity: Major
        Found in plugins/filepwn.py and 5 other locations - About 5 hrs to fix
        plugins/filepwn.py on lines 427..437
        plugins/filepwn.py on lines 438..448
        plugins/filepwn.py on lines 457..466
        plugins/filepwn.py on lines 468..477
        plugins/filepwn.py on lines 479..488

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

        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.WindowsIntelx64['PATCH_TYPE'].lower() == 'append':
                                add_section = True
                            elif self.WindowsIntelx64['PATCH_TYPE'].lower() == 'jump':
                                cave_jumping = True
        Severity: Major
        Found in plugins/filepwn.py and 1 other location - About 2 hrs to fix
        plugins/filepwn.py on lines 393..396

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

        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.WindowsIntelx86['PATCH_TYPE'].lower() == 'append':
                                add_section = True
                            elif self.WindowsIntelx86['PATCH_TYPE'].lower() == 'jump':
                                cave_jumping = True
        Severity: Major
        Found in plugins/filepwn.py and 1 other location - About 2 hrs to fix
        plugins/filepwn.py on lines 360..363

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

        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.check_keyword(info.name.lower()) is True:
                        self.log.info('Tar blacklist enforced on {0}'.format(info.name))
                        continue
        Severity: Major
        Found in plugins/filepwn.py and 1 other location - About 1 hr to fix
        plugins/filepwn.py on lines 292..294

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

        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.check_keyword(info.filename.lower()) is True:
                        self.log.info('Zip blacklist enforced on {0}'.format(info.filename))
                        continue
        Severity: Major
        Found in plugins/filepwn.py and 1 other location - About 1 hr to fix
        plugins/filepwn.py on lines 202..204

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

        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 not info.isfile():
                        self.log.warning("{0} is not a file, skipping".format(info.name))
                        new_tar_file.addfile(info, tar_file.extractfile(info))
                        continue
        Severity: Minor
        Found in plugins/filepwn.py and 1 other location - About 55 mins to fix
        plugins/filepwn.py on lines 196..199

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

                    if info.size >= long(self.FileSizeMax):
                        self.log.warning("{0} is too big, skipping".format(info.name))
                        new_tar_file.addfile(info, tar_file.extractfile(info))
                        continue
        Severity: Minor
        Found in plugins/filepwn.py and 1 other location - About 55 mins to fix
        plugins/filepwn.py on lines 191..194

        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

        There are no issues that match your filters.

        Category
        Status