CiscoUcs/imcsdk

View on GitHub
imcsdk/imccoreutils.py

Summary

Maintainability
F
1 wk
Test Coverage

File imccoreutils.py has 757 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License prop
Severity: Major
Found in imcsdk/imccoreutils.py - About 1 day to fix

    Function extract_molist_from_method_response has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def extract_molist_from_method_response(method_response,
                                            in_hierarchical=False):
        """
        Methods extracts mo list from response received from imc server i.e.
        external method object
    Severity: Minor
    Found in imcsdk/imccoreutils.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 write_mo_tree has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def write_mo_tree(mo, level=0, depth=None, show_level=[],
                      print_tree=True, tree_dict={}, dn=None):
        """
        Prints tree structure of any managed object
    
    
    Severity: Minor
    Found in imcsdk/imccoreutils.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 write_object has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def write_object(mo_or_list):
        """
        This prints the managed object on the standard output.
        """
    
    
    Severity: Minor
    Found in imcsdk/imccoreutils.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 _show_tree has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def _show_tree(class_id, depth=None, level=0, ancestor_str="",
                   ancestor=[], last_child=True, platform=None):
    
        meta_class_id = imcgenutils.word_u(class_id)
    
    
    Severity: Minor
    Found in imcsdk/imccoreutils.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 get_imc_obj has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_imc_obj(class_id, elem, mo_obj=None):
        """
        This creates object of type ExternalMethod or ManagedObject or GenericMo
        depending on element tag
    
    
    Severity: Minor
    Found in imcsdk/imccoreutils.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 print_mo_hierarchy has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def print_mo_hierarchy(class_id, level=0, depth=None,
                           show_level=[], platform=None):
        """
        print hierarchy of class_id
    
    
    Severity: Minor
    Found in imcsdk/imccoreutils.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 validate_property_value has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def validate_property_value(mo, prop, value):
    
        messages = []
        for platform in IMC_PLATFORM_LIST:
            prop_ = _get_property_from_prop_meta_for_platform(
    Severity: Minor
    Found in imcsdk/imccoreutils.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 write_mo_tree has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def write_mo_tree(mo, level=0, depth=None, show_level=[],
    Severity: Major
    Found in imcsdk/imccoreutils.py - About 50 mins to fix

      Function _show_tree has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _show_tree(class_id, depth=None, level=0, ancestor_str="",
      Severity: Major
      Found in imcsdk/imccoreutils.py - About 50 mins to fix

        Function process_conf_mos_response has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def process_conf_mos_response(response, api='process_conf_mos_response',
        Severity: Minor
        Found in imcsdk/imccoreutils.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              for child in mo.child:
                                  mo.child_remove(child)
                                  child.mark_clean()
                                  child_mo_list.append(child)
                                  break
          Severity: Major
          Found in imcsdk/imccoreutils.py - About 45 mins to fix

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

            def extract_mo_tree_from_config_method_response(method_response,
            Severity: Minor
            Found in imcsdk/imccoreutils.py - About 35 mins to fix

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

              def print_mo_hierarchy(class_id, level=0, depth=None,
              Severity: Minor
              Found in imcsdk/imccoreutils.py - About 35 mins to fix

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

                    def __init__(
                Severity: Minor
                Found in imcsdk/imccoreutils.py - About 35 mins to fix

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

                  def get_meta_info(class_id, include_prop=True,
                  Severity: Minor
                  Found in imcsdk/imccoreutils.py - About 35 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return mo_obj
                    Severity: Major
                    Found in imcsdk/imccoreutils.py - About 30 mins to fix

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

                      def get_mo_meta(mo, platform=None):
                      
                          if platform:
                              try:
                                  return mo.mo_meta[platform]
                      Severity: Minor
                      Found in imcsdk/imccoreutils.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 2 locations. Consider refactoring.
                      Open

                          if key_all_mo not in tree_dict:
                              tree_dict[key_all_mo] = {mo.class_id: [mo]}
                          else:
                              if mo.class_id not in tree_dict[key_all_mo]:
                                  tree_dict[key_all_mo][mo.class_id] = [mo]
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 5 hrs to fix
                      imcsdk/imccoreutils.py on lines 394..400

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

                      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 level_key_mo not in tree_dict:
                              tree_dict[level_key_mo] = {mo.class_id: [mo]}
                          else:
                              if mo.class_id not in tree_dict[level_key_mo]:
                                  tree_dict[level_key_mo][mo.class_id] = [mo]
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 5 hrs to fix
                      imcsdk/imccoreutils.py on lines 403..409

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

                      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 _get_property_from_prop_map_for_platform(mo, prop, platform):
                      
                          if platform in list(mo.prop_map.keys()) and \
                                  prop in list(mo.prop_map[platform].keys()):
                              return mo.prop_map[platform][prop]
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 4 hrs to fix
                      imcsdk/imccoreutils.py on lines 741..747

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

                      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 _get_property_from_prop_meta_for_platform(mo, prop, platform):
                      
                          if platform in list(mo.prop_meta.keys()) and \
                                  prop in list(mo.prop_meta[platform].keys()):
                              return mo.prop_meta[platform][prop]
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 4 hrs to fix
                      imcsdk/imccoreutils.py on lines 816..822

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

                      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 get_server_dn(handle, server_id="1"):
                          """
                          This method gives the dn for a particular rack server based on
                          the type of platform
                      
                      
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 4 hrs to fix
                      imcsdk/apis/v2/server/kmip.py on lines 23..38

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

                      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

                          for platform in IMC_PLATFORM_LIST:
                              if platform in list(mo.prop_meta.keys()) and \
                                      prop_name in list(mo.prop_meta[platform].keys()):
                                  return True
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 2 hrs to fix
                      imcsdk/imccoreutils.py on lines 808..811

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

                      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

                          for platform in IMC_PLATFORM_LIST:
                              if platform in list(mo.prop_map.keys()) and \
                                      prop_name in list(mo.prop_map[platform].keys()):
                                  return True
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 2 hrs to fix
                      imcsdk/imccoreutils.py on lines 733..736

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

                      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

                              out_str += ("-" * len("ClassId")).ljust(ts * 4) + "-" * len(
                                  self.class_id)+"\n"
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 2 hrs to fix
                      imcsdk/imccoremeta.py on lines 418..419

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

                      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

                              out_str += str("xml_attribute").ljust(ts * 4) + ':' + str(
                                  self.xml_attribute) + "\n"
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 8 other locations - About 1 hr to fix
                      imcsdk/imccoremeta.py on lines 420..421
                      imcsdk/imccoremeta.py on lines 422..423
                      imcsdk/imccoremeta.py on lines 424..425
                      imcsdk/imccoreutils.py on lines 589..590
                      imcsdk/imccoreutils.py on lines 591..592
                      imcsdk/imccoreutils.py on lines 593..593
                      imcsdk/imccoreutils.py on lines 594..595
                      imcsdk/imccoreutils.py on lines 596..596

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

                      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

                              out_str += str("rn").ljust(ts * 4) + ':' + str(
                                  self.rn) + "\n"
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 8 other locations - About 1 hr to fix
                      imcsdk/imccoremeta.py on lines 420..421
                      imcsdk/imccoremeta.py on lines 422..423
                      imcsdk/imccoremeta.py on lines 424..425
                      imcsdk/imccoreutils.py on lines 587..588
                      imcsdk/imccoreutils.py on lines 591..592
                      imcsdk/imccoreutils.py on lines 593..593
                      imcsdk/imccoreutils.py on lines 594..595
                      imcsdk/imccoreutils.py on lines 596..596

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

                      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

                              out_str += str("parents").ljust(ts * 4) + ':' + str(self.parents) + \
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 8 other locations - About 1 hr to fix
                      imcsdk/imccoremeta.py on lines 420..421
                      imcsdk/imccoremeta.py on lines 422..423
                      imcsdk/imccoremeta.py on lines 424..425
                      imcsdk/imccoreutils.py on lines 587..588
                      imcsdk/imccoreutils.py on lines 589..590
                      imcsdk/imccoreutils.py on lines 591..592
                      imcsdk/imccoreutils.py on lines 593..593
                      imcsdk/imccoreutils.py on lines 594..595

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

                      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

                      class ConfigConfMosConstants:
                          RESPONSE_MO_IS_CONFIGURED = 'is_configured'
                          RESPONSE_OBJECT = 'response_object'
                          RESPONSE_MOS = 'response_mos'
                          RESPONSE_STATUS = 'response_status'
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 8 other locations - About 1 hr to fix
                      imcsdk/mometa/aaa/AaaUserAuthPrecedence.py on lines 8..17
                      imcsdk/mometa/aaa/AaaUserSSHKey.py on lines 8..17
                      imcsdk/mometa/adaptor/AdaptorHostFcIf.py on lines 8..17
                      imcsdk/mometa/bios/BiosVfCbsCpuCoreCtrl.py on lines 8..17
                      imcsdk/mometa/bios/BiosVfOSBootWatchdogTimerTimeout.py on lines 8..17
                      imcsdk/mometa/iod/IodSnapshotStart.py on lines 8..17
                      imcsdk/mometa/memory/MemoryPersistentMemoryNamespace.py on lines 8..17
                      imcsdk/mometa/storage/StorageFlexMMCDownloadFile.py on lines 8..17

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

                      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

                              out_str += str("min_version").ljust(ts * 4) + ':' + str(
                                  self.min_version) + "\n"
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 8 other locations - About 1 hr to fix
                      imcsdk/imccoremeta.py on lines 420..421
                      imcsdk/imccoremeta.py on lines 422..423
                      imcsdk/imccoremeta.py on lines 424..425
                      imcsdk/imccoreutils.py on lines 587..588
                      imcsdk/imccoreutils.py on lines 589..590
                      imcsdk/imccoreutils.py on lines 593..593
                      imcsdk/imccoreutils.py on lines 594..595
                      imcsdk/imccoreutils.py on lines 596..596

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

                      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

                              out_str += str("access_privilege").ljust(ts * 4) + ':' + str(
                                  self.access_privilege) + "\n"
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 8 other locations - About 1 hr to fix
                      imcsdk/imccoremeta.py on lines 420..421
                      imcsdk/imccoremeta.py on lines 422..423
                      imcsdk/imccoremeta.py on lines 424..425
                      imcsdk/imccoreutils.py on lines 587..588
                      imcsdk/imccoreutils.py on lines 589..590
                      imcsdk/imccoreutils.py on lines 591..592
                      imcsdk/imccoreutils.py on lines 593..593
                      imcsdk/imccoreutils.py on lines 596..596

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

                      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

                              out_str += str("access").ljust(ts * 4) + ':' + str(self.access) + "\n"
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 8 other locations - About 1 hr to fix
                      imcsdk/imccoremeta.py on lines 420..421
                      imcsdk/imccoremeta.py on lines 422..423
                      imcsdk/imccoremeta.py on lines 424..425
                      imcsdk/imccoreutils.py on lines 587..588
                      imcsdk/imccoreutils.py on lines 589..590
                      imcsdk/imccoreutils.py on lines 591..592
                      imcsdk/imccoreutils.py on lines 594..595
                      imcsdk/imccoreutils.py on lines 596..596

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

                      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 module_name and module_name in MO_CLASS_ID:
                              fq_module_name = mometa.__name__ + ".%s" % module_name
                              module_import = __import__(fq_module_name, globals(), locals(),
                                                         [module_name])
                              return module_import
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 1 hr to fix
                      imcsdk/imccoreutils.py on lines 144..148

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

                      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 module_name and module_name in METHOD_CLASS_ID:
                              fq_module_name = methodmeta.__name__ + ".%sMeta" % module_name
                              module_import = __import__(fq_module_name, globals(), locals(),
                                                         [module_name])
                              return module_import
                      Severity: Major
                      Found in imcsdk/imccoreutils.py and 1 other location - About 1 hr to fix
                      imcsdk/imccoreutils.py on lines 139..143

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

                      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