CiscoUcs/ucsmsdk

View on GitHub
ucsmsdk/ucscoremeta.py

Summary

Maintainability
F
5 days
Test Coverage

Function validate_property_value has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_property_value(self, input_value):
        """validate property value of mo."""
        error_msg = None

        if input_value is None:
Severity: Minor
Found in ucsmsdk/ucscoremeta.py - About 6 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

File ucscoremeta.py has 412 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 at
Severity: Minor
Found in ucsmsdk/ucscoremeta.py - About 5 hrs to fix

    Cyclomatic complexity is too high in method validate_property_value. (25)
    Open

        def validate_property_value(self, input_value):
            """validate property value of mo."""
            error_msg = None
    
            if input_value is None:
    Severity: Minor
    Found in ucsmsdk/ucscoremeta.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    Cyclomatic complexity is too high in method compare_to. (6)
    Open

        def compare_to(self, version):
            """Method to compare UcsVersion."""
            if version is None or not isinstance(version, UcsVersion):
                return 1
    
    
    Severity: Minor
    Found in ucsmsdk/ucscoremeta.py by radon

    Cyclomatic Complexity

    Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

    Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

    Construct Effect on CC Reasoning
    if +1 An if statement is a single decision.
    elif +1 The elif statement adds another decision.
    else +0 The else statement does not cause a new decision. The decision is at the if.
    for +1 There is a decision at the start of the loop.
    while +1 There is a decision at the while statement.
    except +1 Each except branch adds a new conditional path of execution.
    finally +0 The finally block is unconditionally executed.
    with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
    assert +1 The assert statement internally roughly equals a conditional statement.
    Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
    Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

    Source: http://radon.readthedocs.org/en/latest/intro.html

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

        def __init__(self, name, xml_attribute, rn, version, inp_out, mask,
    Severity: Major
    Found in ucsmsdk/ucscoremeta.py - About 1 hr to fix

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

          def __init__(self, name, xml_attribute, field_type, version, access, mask,
      Severity: Major
      Found in ucsmsdk/ucscoremeta.py - About 1 hr to fix

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

            def __init__(self, name, xml_attribute, field_type, version, inp_out,
        Severity: Minor
        Found in ucsmsdk/ucscoremeta.py - About 45 mins to fix

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

              def __init__(self, min_length=None, max_length=None, pattern=None,
          Severity: Minor
          Found in ucsmsdk/ucscoremeta.py - About 35 mins to fix

            Avoid too many return statements within this function.
            Open

                    return ord(self.__patch) - ord(version.patch)
            Severity: Major
            Found in ucsmsdk/ucscoremeta.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return True
              Severity: Major
              Found in ucsmsdk/ucscoremeta.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return True
                Severity: Major
                Found in ucsmsdk/ucscoremeta.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return True
                  Severity: Major
                  Found in ucsmsdk/ucscoremeta.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return True
                    Severity: Major
                    Found in ucsmsdk/ucscoremeta.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return False
                      Severity: Major
                      Found in ucsmsdk/ucscoremeta.py - About 30 mins to fix

                        Method "__init__" has 12 parameters, which is greater than the 7 authorized.
                        Open

                            def __init__(self, name, xml_attribute, field_type, version, access, mask,
                                         min_length, max_length, pattern,
                                         value_set, range_val):
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py by sonar-python

                        A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                        Noncompliant Code Example

                        With a maximum number of 4 parameters:

                        def do_something(param1, param2, param3, param4, param5):
                            ...
                        

                        Compliant Solution

                        def do_something(param1, param2, param3, param4):
                            ...
                        

                        Refactor this function to reduce its Cognitive Complexity from 41 to the 15 allowed.
                        Open

                            def validate_property_value(self, input_value):
                        Severity: Critical
                        Found in ucsmsdk/ucscoremeta.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Method "__init__" has 12 parameters, which is greater than the 7 authorized.
                        Open

                            def __init__(self, name, xml_attribute, rn, version, inp_out, mask,
                                         field_names, access, parents, children, verbs):
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py by sonar-python

                        A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                        Noncompliant Code Example

                        With a maximum number of 4 parameters:

                        def do_something(param1, param2, param3, param4, param5):
                            ...
                        

                        Compliant Solution

                        def do_something(param1, param2, param3, param4):
                            ...
                        

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

                                if match_obj:
                                    self.__major = match_obj.group("major")
                                    self.__minor = match_obj.group("minor")
                                    self.__mr = match_obj.group("mr")
                                    self.__patch = match_obj.group("patch")
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 1 other location - About 2 hrs to fix
                        ucsmsdk/ucscoremeta.py on lines 51..56

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

                        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

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

                                if match_obj:
                                    self.__major = match_obj.group("major")
                                    self.__minor = match_obj.group("minor")
                                    self.__mr = match_obj.group("mr")
                                    self.__patch = match_obj.group("patch")
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 1 other location - About 2 hrs to fix
                        ucsmsdk/ucscoremeta.py on lines 63..68

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

                        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("Property")).ljust(ts * 4) + "-" * len(
                                    self.name) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 1 other location - About 2 hrs to fix
                        ucsmsdk/ucscoreutils.py on lines 542..543

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

                                out_str += str("min_length").ljust(ts * 4) + ':' + str(
                                    self.restriction.min_length) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 3 other locations - About 1 hr to fix
                        ucsmsdk/ucscoremeta.py on lines 352..353
                        ucsmsdk/ucscoremeta.py on lines 354..355
                        ucsmsdk/ucscoremeta.py on lines 356..357

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

                        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

                                out_str += str("value_set").ljust(ts * 4) + ':' + str(
                                    self.restriction.value_set) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 3 other locations - About 1 hr to fix
                        ucsmsdk/ucscoremeta.py on lines 350..351
                        ucsmsdk/ucscoremeta.py on lines 352..353
                        ucsmsdk/ucscoremeta.py on lines 354..355

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

                        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

                                out_str += str("pattern").ljust(ts * 4) + ':' + str(
                                    self.restriction.pattern) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 3 other locations - About 1 hr to fix
                        ucsmsdk/ucscoremeta.py on lines 350..351
                        ucsmsdk/ucscoremeta.py on lines 352..353
                        ucsmsdk/ucscoremeta.py on lines 356..357

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

                        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

                                out_str += str("max_length").ljust(ts * 4) + ':' + str(
                                    self.restriction.max_length) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 3 other locations - About 1 hr to fix
                        ucsmsdk/ucscoremeta.py on lines 350..351
                        ucsmsdk/ucscoremeta.py on lines 354..355
                        ucsmsdk/ucscoremeta.py on lines 356..357

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

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

                                out_str += str("min_version").ljust(ts * 4) + ':' + str(
                                    self.version) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 17 other locations - About 1 hr to fix
                        ucsmsdk/utils/ccoimage.py on lines 68..69
                        ucsmsdk/utils/ccoimage.py on lines 70..71
                        ucsmsdk/utils/ccoimage.py on lines 72..72
                        ucsmsdk/utils/ccoimage.py on lines 73..74
                        ucsmsdk/utils/ccoimage.py on lines 75..76
                        ucsmsdk/utils/ccoimage.py on lines 77..78
                        ucsmsdk/utils/ccoimage.py on lines 79..80
                        ucsmsdk/utils/ccoimage.py on lines 81..82
                        ucsmsdk/utils/ccoimage.py on lines 83..84
                        ucsmsdk/ucscoremeta.py on lines 342..343
                        ucsmsdk/ucscoremeta.py on lines 344..345
                        ucsmsdk/ucscoreutils.py on lines 544..545
                        ucsmsdk/ucscoreutils.py on lines 546..547
                        ucsmsdk/ucscoreutils.py on lines 548..549
                        ucsmsdk/ucscoreutils.py on lines 550..550
                        ucsmsdk/ucscoreutils.py on lines 551..552
                        ucsmsdk/ucscoreutils.py on lines 553..553

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

                                out_str += str("xml_attribute").ljust(ts * 4) + ':' + str(
                                    self.xml_attribute) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 17 other locations - About 1 hr to fix
                        ucsmsdk/utils/ccoimage.py on lines 68..69
                        ucsmsdk/utils/ccoimage.py on lines 70..71
                        ucsmsdk/utils/ccoimage.py on lines 72..72
                        ucsmsdk/utils/ccoimage.py on lines 73..74
                        ucsmsdk/utils/ccoimage.py on lines 75..76
                        ucsmsdk/utils/ccoimage.py on lines 77..78
                        ucsmsdk/utils/ccoimage.py on lines 79..80
                        ucsmsdk/utils/ccoimage.py on lines 81..82
                        ucsmsdk/utils/ccoimage.py on lines 83..84
                        ucsmsdk/ucscoremeta.py on lines 344..345
                        ucsmsdk/ucscoremeta.py on lines 346..347
                        ucsmsdk/ucscoreutils.py on lines 544..545
                        ucsmsdk/ucscoreutils.py on lines 546..547
                        ucsmsdk/ucscoreutils.py on lines 548..549
                        ucsmsdk/ucscoreutils.py on lines 550..550
                        ucsmsdk/ucscoreutils.py on lines 551..552
                        ucsmsdk/ucscoreutils.py on lines 553..553

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

                                out_str += str("field_type").ljust(ts * 4) + ':' + str(
                                    self.field_type) + "\n"
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 17 other locations - About 1 hr to fix
                        ucsmsdk/utils/ccoimage.py on lines 68..69
                        ucsmsdk/utils/ccoimage.py on lines 70..71
                        ucsmsdk/utils/ccoimage.py on lines 72..72
                        ucsmsdk/utils/ccoimage.py on lines 73..74
                        ucsmsdk/utils/ccoimage.py on lines 75..76
                        ucsmsdk/utils/ccoimage.py on lines 77..78
                        ucsmsdk/utils/ccoimage.py on lines 79..80
                        ucsmsdk/utils/ccoimage.py on lines 81..82
                        ucsmsdk/utils/ccoimage.py on lines 83..84
                        ucsmsdk/ucscoremeta.py on lines 342..343
                        ucsmsdk/ucscoremeta.py on lines 346..347
                        ucsmsdk/ucscoreutils.py on lines 544..545
                        ucsmsdk/ucscoreutils.py on lines 546..547
                        ucsmsdk/ucscoreutils.py on lines 548..549
                        ucsmsdk/ucscoreutils.py on lines 550..550
                        ucsmsdk/ucscoreutils.py on lines 551..552
                        ucsmsdk/ucscoreutils.py on lines 553..553

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

                                if self.__minor != version.minor:
                                    return ord(self.__minor) - ord(version.minor)
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 2 other locations - About 45 mins to fix
                        ucsmsdk/ucscoremeta.py on lines 110..111
                        ucsmsdk/ucscoremeta.py on lines 114..115

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

                        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 self.__major != version.major:
                                    return ord(self.__major) - ord(version.major)
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 2 other locations - About 45 mins to fix
                        ucsmsdk/ucscoremeta.py on lines 112..113
                        ucsmsdk/ucscoremeta.py on lines 114..115

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

                        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 self.__mr != version.mr:
                                    return ord(self.__mr) - ord(version.mr)
                        Severity: Major
                        Found in ucsmsdk/ucscoremeta.py and 2 other locations - About 45 mins to fix
                        ucsmsdk/ucscoremeta.py on lines 110..111
                        ucsmsdk/ucscoremeta.py on lines 112..113

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

                        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

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

                                    if match:
                                        return True
                                    else:
                                        error_msg = (str(self.name) + " should adhere to regex " +
                                                     str(pattern))
                        Severity: Minor
                        Found in ucsmsdk/ucscoremeta.py and 1 other location - About 45 mins to fix
                        ucsmsdk/ucscoremeta.py on lines 301..305

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

                        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

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

                                    if match:
                                        return True
                                    else:
                                        error_msg = (str(self.name) + " should adhere to regex " +
                                                     str(pattern))
                        Severity: Minor
                        Found in ucsmsdk/ucscoremeta.py and 1 other location - About 45 mins to fix
                        ucsmsdk/ucscoremeta.py on lines 309..313

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

                        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