gecos-team/gecoscc-ui

View on GitHub
gecoscc/commands/check_node_policies.py

Summary

Maintainability
F
2 wks
Test Coverage

File check_node_policies.py has 725 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#
# Copyright 2017, Junta de Andalucia
# http://www.juntadeandalucia.es/
#
# Authors:
Severity: Major
Found in gecoscc/commands/check_node_policies.py - About 1 day to fix

    Function command has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
    Open

        def command(self):
            # Initialization
            self.api = _get_chef_api(self.settings.get('chef.url'),
                                toChefUsername(self.options.chef_username),
                                self.options.chef_pem, False,
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.py - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function check_node has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_node(self, node):
            '''
            Check the policies applied to a node
            '''        
            logger.info('Checking node: "%s" type:%s path: %s'%(node['name'],
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.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 get_default_data has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_default_data(self, dotted_keys):
            # Get gecos_ws_mgmt cookbook version
            data = None
            try:
                data = self.api['/organizations/default/cookbooks/gecos_ws_mgmt']
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.py - About 7 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function check_user_data has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_user_data(self, user):
            if user['type'] != 'user':
                raise ValueError('user must be an user')
            
            if ((not 'email' in user or user['email']=='') and
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.py - About 7 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function check_object_property has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_object_property(self, schema, nodedata, propertyname, is_emitter,
                emitter_policy_slug):
            if schema is None:
                raise ValueError('Schema is None!')
                
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.py - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function check_updated_by_field has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_updated_by_field(self, node_id, key, attributes):
            updated = False
            if isinstance(attributes, dict):
                for attribute in attributes:
                    if attribute == 'updated_by':
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.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 check_string_property has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_string_property(self, schema, nodedata, property_name, is_emitter,
                 emitter_policy_slug):
            if schema is None:
                raise ValueError('Schema is None!')
                
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.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 check_array_property has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_array_property(self, schema, nodedata, propertyname, is_emitter,
                                 emitter_policy_slug):
            if schema is None:
                raise ValueError('Schema is None!')
                
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.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 check_chef_node_policies has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_chef_node_policies(self, node_id, key, attributes):
            updated = False
            if 'gecos_ws_mgmt' in attributes:
                to_delete = []
                for group in attributes['gecos_ws_mgmt']:
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.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 get_default_data has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def get_default_data(self, dotted_keys):
            # Get gecos_ws_mgmt cookbook version
            data = None
            try:
                data = self.api['/organizations/default/cookbooks/gecos_ws_mgmt']
    Severity: Minor
    Found in gecoscc/commands/check_node_policies.py - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                              if attributes['updated_by']['group'] != sorted_groups:
                                  logger.info("Sorting updated_by field for node ",
                                              "{0} - {1}!".format(node_id, key)) 
                                  attributes['updated_by']['group'] = sorted_groups
                                  updated = True
      Severity: Major
      Found in gecoscc/commands/check_node_policies.py - About 45 mins to fix

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

            def check_referenced_nodes(self, id_list, possible_types, property_name):
                '''
                Check if the nodes with ID in the id_list exists in the database
                and its types belong to the possible_types list
                '''           
        Severity: Minor
        Found in gecoscc/commands/check_node_policies.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

        Avoid deeply nested control flow statements.
        Open

                                if ((not variable in created) and 
                                    len(variable) != len(left)):
                                    created.append(variable)
                                    header += variable+' = {}\n'
                        else:
        Severity: Major
        Found in gecoscc/commands/check_node_policies.py - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if ((not 'email' in user or user['email']=='') and
                      (not 'first_name' in user or user['first_name']=='') and
                      (not 'last_name' in user or user['last_name']=='')):
                      
                      # Nothing to do
          Severity: Major
          Found in gecoscc/commands/check_node_policies.py - About 40 mins to fix

            Function check_array_property has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def check_array_property(self, schema, nodedata, propertyname, is_emitter,
            Severity: Minor
            Found in gecoscc/commands/check_node_policies.py - About 35 mins to fix

              Function check_string_property has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def check_string_property(self, schema, nodedata, property_name, is_emitter,
              Severity: Minor
              Found in gecoscc/commands/check_node_policies.py - About 35 mins to fix

                Function check_object_property has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def check_object_property(self, schema, nodedata, propertyname, is_emitter,
                Severity: Minor
                Found in gecoscc/commands/check_node_policies.py - About 35 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return None
                  Severity: Major
                  Found in gecoscc/commands/check_node_policies.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return None
                    Severity: Major
                    Found in gecoscc/commands/check_node_policies.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return default
                      Severity: Major
                      Found in gecoscc/commands/check_node_policies.py - About 30 mins to fix

                        Function check_number_property has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def check_number_property(self, schema, nodedata, property_name):
                                if schema is None:
                                    raise ValueError('Schema is None!')
                                    
                                if nodedata is None:
                        Severity: Minor
                        Found in gecoscc/commands/check_node_policies.py - About 25 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

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

                                            if (not node.normal.has_dotted(
                                                'gecos_info.users.%s.firstName'%(username)) or 
                                                node.normal.get_dotted('gecos_info.users.%s.firstName'%(
                                                    username)) != user['first_name']):
                                                node.normal.set_dotted('gecos_info.users.%s.firstName'%(
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 4 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 694..700
                        gecoscc/commands/check_node_policies.py on lines 710..716

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

                        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

                                            if (not node.normal.has_dotted('gecos_info.users.%s.email'%(
                                                username)) or node.normal.get_dotted(
                                                    'gecos_info.users.%s.email'%(
                                                        username)) != user['email']):
                                                node.normal.set_dotted('gecos_info.users.%s.email'%(
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 4 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 702..708
                        gecoscc/commands/check_node_policies.py on lines 710..716

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

                        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

                                            if (not node.normal.has_dotted(
                                                'gecos_info.users.%s.lastName'%(username)) or
                                                node.normal.get_dotted('gecos_info.users.%s.lastName'%(
                                                    username)) != user['last_name']):
                                                node.normal.set_dotted('gecos_info.users.%s.lastName'%(
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 4 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 694..700
                        gecoscc/commands/check_node_policies.py on lines 702..708

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                    if len(difference) > 0:
                                        logger.info('FIXED: remove %s references'%(difference))
                                        self.db.nodes.update({'_id': ObjectId(node['_id'])},
                                            {'$set': {'memberof': new_id_list}})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 3 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 607..610
                        gecoscc/commands/check_node_policies.py on lines 630..633
                        gecoscc/commands/check_node_policies.py on lines 641..644
                        gecoscc/commands/check_node_policies.py on lines 651..654

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                    if len(difference) > 0:
                                        logger.info('FIXED: remove %s references'%(difference))
                                        self.db.nodes.update({'_id': ObjectId(node['_id'])},
                                            {'$set': {'memberof': new_id_list}})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 3 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 607..610
                        gecoscc/commands/check_node_policies.py on lines 619..622
                        gecoscc/commands/check_node_policies.py on lines 630..633
                        gecoscc/commands/check_node_policies.py on lines 651..654

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                    if len(difference) > 0:
                                        logger.info('FIXED: remove %s references'%(difference))
                                        self.db.nodes.update({'_id': ObjectId(node['_id'])},
                                            {'$set': {'members': new_id_list}})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 3 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 607..610
                        gecoscc/commands/check_node_policies.py on lines 619..622
                        gecoscc/commands/check_node_policies.py on lines 630..633
                        gecoscc/commands/check_node_policies.py on lines 641..644

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                    if len(difference) > 0:
                                        logger.info('FIXED: remove %s references'%(difference))
                                        self.db.nodes.update({'_id': ObjectId(node['_id'])},
                                            {'$set': {'computers': new_id_list}})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 3 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 619..622
                        gecoscc/commands/check_node_policies.py on lines 630..633
                        gecoscc/commands/check_node_policies.py on lines 641..644
                        gecoscc/commands/check_node_policies.py on lines 651..654

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

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

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

                                    if len(difference) > 0:
                                        logger.info('FIXED: remove %s references'%(difference))
                                        self.db.nodes.update({'_id': ObjectId(node['_id'])},
                                            {'$set': {'memberof': new_id_list}})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 3 hrs to fix
                        gecoscc/commands/check_node_policies.py on lines 607..610
                        gecoscc/commands/check_node_policies.py on lines 619..622
                        gecoscc/commands/check_node_policies.py on lines 641..644
                        gecoscc/commands/check_node_policies.py on lines 651..654

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

                        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

                                    self.db.nodes.update({'_id': ObjectId(node['_id'])},
                                        {'$set': {'inheritance': inheritance_node['inheritance']}})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 1 other location - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 584..586

                        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 changed:
                                        self.db.nodes.update({'_id': ObjectId(node['_id'])},
                                                             {'$set': {'policies': node['policies']}})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 1 other location - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 598..599

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

                                    if not 'type' in node:
                                        logger.error('Node with ID: %s has no "type" attribute!'%(
                                            str(node['_id'])))                
                                        continue
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 321..324
                        gecoscc/commands/check_node_policies.py on lines 326..329

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

                        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

                                    if not 'name' in node:
                                        logger.error('Node with ID: %s has no "name" attribute!'%(
                                            str(node['_id'])))                
                                        continue
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 321..324
                        gecoscc/commands/check_node_policies.py on lines 331..334

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

                        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

                                    if not 'path' in node:
                                        logger.error('Node with ID: %s has no "path" attribute!'%(
                                            str(node['_id'])))                
                                        continue
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 326..329
                        gecoscc/commands/check_node_policies.py on lines 331..334

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

                        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 (not node.normal.has_dotted('gecos_info.users.%s'%(
                                                username))):
                                                node.normal.set_dotted('gecos_info.users.%s'%(
                                                    username), {})
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 3 other locations - About 1 hr to fix
                        gecoscc/tasks.py on lines 1340..1341
                        gecoscc/tasks.py on lines 1962..1963
                        gecoscc/tasks.py on lines 2522..2523

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

                        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

                                    elif prop_type == 'string':
                                        self.check_string_property(schema['properties'][str(prop)],
                                            nodedata[str(prop)], name, is_emitter, emitter_policy_slug)
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 865..867
                        gecoscc/commands/check_node_policies.py on lines 873..875

                        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

                                    elif prop_type == 'object':
                                        self.check_object_property(schema['properties'][str(prop)],
                                            nodedata[str(prop)], name, is_emitter, emitter_policy_slug)
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 865..867
                        gecoscc/commands/check_node_policies.py on lines 869..871

                        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

                                    if prop_type == 'array':
                                        self.check_array_property(schema['properties'][str(prop)],
                                            nodedata[str(prop)], name, is_emitter, emitter_policy_slug)
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 2 other locations - About 1 hr to fix
                        gecoscc/commands/check_node_policies.py on lines 869..871
                        gecoscc/commands/check_node_policies.py on lines 873..875

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

                                if not check_unique_node_name_by_type_at_domain(self.db.nodes, node):
                                    logger.error('Duplicates found for node: "%s" type:%s path: %s'%(
                                        node['name'], node['type'], node['path']))
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 55 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 508..509
                        gecoscc/commands/check_node_policies.py on lines 518..521
                        gecoscc/commands/check_node_policies.py on lines 719..721
                        gecoscc/utils.py on lines 1986..1986

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

                                    if domain['name'].lower() == node['name'].lower():            
                                        logger.error('The node has the same name as the domain: "%s" '\
                                                     'type:%s path: %s'%(node['name'], node['type'],
                                                                         node['path']))
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 55 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 508..509
                        gecoscc/commands/check_node_policies.py on lines 512..514
                        gecoscc/commands/check_node_policies.py on lines 719..721
                        gecoscc/utils.py on lines 1986..1986

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

                                                logger.info("Updating user %s data in computer: %s "\
                                                    "Chef ID: %s"%(user['name'], computer['name'],
                                                                   computer['node_chef_id']))
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 55 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 508..509
                        gecoscc/commands/check_node_policies.py on lines 512..514
                        gecoscc/commands/check_node_policies.py on lines 518..521
                        gecoscc/utils.py on lines 1986..1986

                        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

                                self.api = _get_chef_api(self.settings.get('chef.url'),
                                                    toChefUsername(self.options.chef_username),
                                                    self.options.chef_pem, False,
                                                    self.settings.get('chef.version'))
                        Severity: Minor
                        Found in gecoscc/commands/check_node_policies.py and 1 other location - About 55 mins to fix
                        gecoscc/commands/mobile_broadband_providers.py on lines 57..59

                        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

                                    elif prop_type == 'boolean':
                                        self.check_boolean_property(schema['properties'][str(prop)],
                                            nodedata[str(prop)], name)
                        Severity: Minor
                        Found in gecoscc/commands/check_node_policies.py and 1 other location - About 55 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 877..879

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

                                logger.info('Checking node: "%s" type:%s path: %s'%(node['name'],
                                    node['type'], node['path']))
                        Severity: Major
                        Found in gecoscc/commands/check_node_policies.py and 4 other locations - About 55 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 512..514
                        gecoscc/commands/check_node_policies.py on lines 518..521
                        gecoscc/commands/check_node_policies.py on lines 719..721
                        gecoscc/utils.py on lines 1986..1986

                        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

                                    elif (prop_type == 'number') or (prop_type == 'integer'):
                                        self.check_number_property(schema['properties'][str(prop)],
                                            nodedata[str(prop)], name)
                        Severity: Minor
                        Found in gecoscc/commands/check_node_policies.py and 1 other location - About 55 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 881..883

                        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 (not computer_node.attributes.has_dotted('gecos_path_ids')
                                            or computer_node.attributes.get_dotted(
                        Severity: Minor
                        Found in gecoscc/commands/check_node_policies.py and 1 other location - About 30 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 433..434

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

                        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 computer_node.attributes.has_dotted('gecos_path_names')
                                            or computer_node.attributes.get_dotted(
                        Severity: Minor
                        Found in gecoscc/commands/check_node_policies.py and 1 other location - About 30 mins to fix
                        gecoscc/commands/check_node_policies.py on lines 416..417

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

                        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