hackedteam/test-av

View on GitHub

Showing 1,471 of 1,471 total issues

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

        elif nodeName_ == 'Description':
            obj_ = StructuredTextType.factory()
            obj_.build(child_)
            self.set_Description(obj_)
        elif nodeName_ == 'Effects':
Severity: Major
Found in lib/maec/maec11.py and 1 other location - About 1 day to fix
lib/maec/maec11.py on lines 2345..2364

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

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

PE has 73 functions (exceeds 20 allowed). Consider refactoring.
Open

class PE:
    """A Portable Executable representation.
    
    This class provides access to most of the information in a PE file.
    
Severity: Major
Found in lib/pefile/pefile.py - About 1 day to fix

    Function write has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
    Open

        def write(self, filename=None):
            """Write the PE file.
            
            This function will process all headers and components
            of the PE file and include all changes made (by just
    Severity: Minor
    Found in lib/pefile/pefile.py - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function parse_resources_directory has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_resources_directory(self, rva, size=0, base_rva = None, level = 0, dirs=None):
            """Parse the resources directory.
            
            Given the RVA of the resources directory, it will process all
            its entries.
    Severity: Minor
    Found in lib/pefile/pefile.py - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

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

            elif nodeName_ == 'Start_Address':
                obj_ = xs_hexBinary.factory()
                obj_.build(child_)
                self.set_Start_Address(obj_)
            elif nodeName_ == 'Parent_Process':
    Severity: Major
    Found in lib/maec/maec11.py and 1 other location - About 1 day to fix
    lib/maec/maec11.py on lines 4470..4486

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

    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 buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
            if nodeName_ == 'Discovery_Method':
                obj_ = DiscoveryMethod.factory()
                obj_.build(child_)
                self.set_Discovery_Method(obj_)
    Severity: Major
    Found in lib/maec/maec11.py and 1 other location - About 1 day to fix
    lib/maec/maec11.py on lines 15089..15108

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

    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 exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PE_Binary_AttributesType'):
            if self.dll_count is not None and 'dll_count' not in already_processed:
                already_processed.append('dll_count')
                outfile.write(' dll_count="%s"' % self.gds_format_integer(self.dll_count, input_name='dll_count'))
            if self.type_ is not None and 'type_' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 1 other location - About 1 day to fix
    lib/maec/maec11.py on lines 5768..5774

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

    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 exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='malwareMetaData'):
            if self.version is not None and 'version' not in already_processed:
                already_processed.append('version')
                outfile.write(' version="%s"' % self.gds_format_float(self.version, input_name='version'))
            if self.id is not None and 'id' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 1 other location - About 1 day to fix
    lib/maec/maec11.py on lines 11338..11344

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

    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 parse_directory_load_config(self, rva, size):
            """"""
            
            if self.PE_TYPE == OPTIONAL_HEADER_MAGIC_PE:
                format = self.__IMAGE_LOAD_CONFIG_DIRECTORY_format__
    Severity: Major
    Found in lib/pefile/pefile.py and 1 other location - About 1 day to fix
    lib/pefile/pefile.py on lines 2383..2406

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

    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 parse_directory_tls(self, rva, size):
            """"""
            
            if self.PE_TYPE == OPTIONAL_HEADER_MAGIC_PE:
                format = self.__IMAGE_TLS_DIRECTORY_format__
    Severity: Major
    Found in lib/pefile/pefile.py and 1 other location - About 1 day to fix
    lib/pefile/pefile.py on lines 2409..2432

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='DiscoveryMethod'):
            if self.tool_id is not None and 'tool_id' not in already_processed:
                already_processed.append('tool_id')
                outfile.write(' tool_id=%s' % (quote_attrib(self.tool_id), ))
            if self.method is not None and 'method' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 6884..6890
    lib/maec/maec11.py on lines 11135..11141

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorCollectionType'):
            if self.id is not None and 'id' not in already_processed:
                already_processed.append('id')
                outfile.write(' id=%s' % (quote_attrib(self.id), ))
            if self.name is not None and 'name' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 6884..6890
    lib/maec/maec11.py on lines 11135..11141

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectCollectionType'):
            if self.id is not None and 'id' not in already_processed:
                already_processed.append('id')
                outfile.write(' id=%s' % (quote_attrib(self.id), ))
            if self.name is not None and 'name' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 6884..6890
    lib/maec/maec11.py on lines 11135..11141

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='DataType'):
            if self.id is not None and 'id' not in already_processed:
                already_processed.append('id')
                outfile.write(' id=%s' % (quote_attrib(self.id), ))
            if self.format is not None and 'format' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 6884..6890
    lib/maec/maec11.py on lines 11135..11141

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectCollectionType'):
            if self.id is not None and 'id' not in already_processed:
                already_processed.append('id')
                outfile.write(' id=%s' % (quote_attrib(self.id), ))
            if self.name is not None and 'name' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 6884..6890
    lib/maec/maec11.py on lines 11135..11141

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashType'):
            if self.type_ is not None and 'type_' not in already_processed:
                already_processed.append('type_')
                outfile.write(' type=%s' % (quote_attrib(self.type_), ))
            if self.other_type is not None and 'other_type' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 6884..6890
    lib/maec/maec11.py on lines 11135..11141

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='classificationObject'):
            if self.type_ is not None and 'type_' not in already_processed:
                already_processed.append('type_')
                outfile.write(' type=%s' % (quote_attrib(self.type_), ))
            if self.id is not None and 'id' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 11135..11141

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Packer_TypeType'):
            if self.type_ is not None and 'type_' not in already_processed:
                already_processed.append('type_')
                outfile.write(' type=%s' % (quote_attrib(self.type_), ))
            if self.id is not None and 'id' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 1143..1149
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 6884..6890

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

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

        def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionCollectionType'):
            if self.id is not None and 'id' not in already_processed:
                already_processed.append('id')
                outfile.write(' id=%s' % (quote_attrib(self.id), ))
            if self.name is not None and 'name' not in already_processed:
    Severity: Major
    Found in lib/maec/maec11.py and 8 other locations - About 1 day to fix
    lib/maec/maec11.py on lines 584..590
    lib/maec/maec11.py on lines 2229..2235
    lib/maec/maec11.py on lines 4025..4031
    lib/maec/maec11.py on lines 4194..4200
    lib/maec/maec11.py on lines 4525..4531
    lib/maec/maec11.py on lines 4614..4620
    lib/maec/maec11.py on lines 6884..6890
    lib/maec/maec11.py on lines 11135..11141

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

    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 refreshShot(self, vmx):
            if vmx == "all":
                sys.stdout.write("[*] Refresh snapshots on guests.\n")
                for vm in vms:
                    self.cmd.refreshSnapshot(self.conf.getVmx(vm), 'current')
    Severity: Major
    Found in utils/manager/av_updates.py and 1 other location - About 1 day to fix
    utils/manager/win_updates.py on lines 80..90

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

    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