CiscoUcs/ucsmsdk

View on GitHub
ucsmsdk/utils/ccoimage.py

Summary

Maintainability
F
3 days
Test Coverage

Function get_ucs_cco_image_list has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

def get_ucs_cco_image_list(username=None, password=None, mdf_id_list=None,
                           proxy=None):
    """
    Gets the list of images available on CCO

Severity: Minor
Found in ucsmsdk/utils/ccoimage.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

Cyclomatic complexity is too high in function get_ucs_cco_image_list. (22)
Open

def get_ucs_cco_image_list(username=None, password=None, mdf_id_list=None,
                           proxy=None):
    """
    Gets the list of images available on CCO

Severity: Minor
Found in ucsmsdk/utils/ccoimage.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 function get_ucs_cco_image. (8)
Open

def get_ucs_cco_image(image, file_dir, proxy=None):
    """
    Downloads image from CCO

    Args:
Severity: Minor
Found in ucsmsdk/utils/ccoimage.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 get_ucs_cco_image_list has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def get_ucs_cco_image_list(username=None, password=None, mdf_id_list=None,
                           proxy=None):
    """
    Gets the list of images available on CCO

Severity: Minor
Found in ucsmsdk/utils/ccoimage.py - About 1 hr to fix

    Function get_ucs_cco_image has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_ucs_cco_image(image, file_dir, proxy=None):
        """
        Downloads image from CCO
    
        Args:
    Severity: Minor
    Found in ucsmsdk/utils/ccoimage.py - About 35 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

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

    def get_ucs_cco_image_list(username=None, password=None, mdf_id_list=None,
    Severity: Critical
    Found in ucsmsdk/utils/ccoimage.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

    Merge this if statement with the enclosing one.
    Open

                    if property_node.getAttribute("type") == "md5":
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py by sonar-python

    Merging collapsible if statements increases the code's readability.

    Noncompliant Code Example

    if condition1:
        if condition2:
            # ...
    

    Compliant Solution

    if condition1 and condition2:
        # ...
    

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

            out_str += str("version").ljust(tab_size * 4) + ':' + str(
                self.version) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py and 17 other locations - About 1 hr to fix
    ucsmsdk/utils/ccoimage.py on lines 68..69
    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/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("ip_url").ljust(tab_size * 4) + ':' + str(
                self.ip_url) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.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 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/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("url").ljust(tab_size * 4) + ':' + str(self.url) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.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 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/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("file_description").ljust(tab_size * 4) + ':' + str(
                self.file_description) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.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 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/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("network_credential").ljust(tab_size * 4) + ':' + str(
                self.network_credential) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.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 83..84
    ucsmsdk/ucscoremeta.py on lines 342..343
    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("size").ljust(tab_size * 4) + ':' + str(
                self.size) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.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 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/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("image_name").ljust(tab_size * 4) + ':' + str(
                self.image_name) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py and 17 other locations - About 1 hr to fix
    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/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("checksum_md5").ljust(tab_size * 4) + ':' + str(
                self.checksum_md5) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.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 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/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("proxy").ljust(tab_size * 4) + ':' + str(
                self.proxy) + "\n"
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.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/ucscoremeta.py on lines 342..343
    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 2 locations. Consider refactoring.
    Open

        if not md5_sum:
            UcsWarning("Unable to generate md5sum for file <%s>" % local_file)
            UcsWarning("Deleting file <%s> ....." % local_file)
            os.remove(local_file)
            return
    Severity: Minor
    Found in ucsmsdk/utils/ccoimage.py and 1 other location - About 55 mins to fix
    ucsmsdk/utils/ccoimage.py on lines 259..263

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

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

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

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

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

    Refactorings

    Further Reading

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

        if md5_sum != image.checksum_md5:
            UcsWarning("Incorrect md5sum for file <%s>" % local_file)
            UcsWarning("Deleting file <%s> ....." % local_file)
            os.remove(local_file)
            return
    Severity: Minor
    Found in ucsmsdk/utils/ccoimage.py and 1 other location - About 55 mins to fix
    ucsmsdk/utils/ccoimage.py on lines 252..256

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

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

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

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

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

    Refactorings

    Further Reading

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

                if property_node.getAttribute(
                        "name") == _UcsCcoImageList.IDAC_TAG_VERSION:
                    image.version = property_node.getAttribute("value")
                    continue
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py and 4 other locations - About 30 mins to fix
    ucsmsdk/utils/ccoimage.py on lines 178..181
    ucsmsdk/utils/ccoimage.py on lines 182..185
    ucsmsdk/utils/ccoimage.py on lines 186..189
    ucsmsdk/utils/ccoimage.py on lines 199..202

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 32.

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

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

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

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

    Refactorings

    Further Reading

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

                if property_node.getAttribute(
                        "name") == _UcsCcoImageList.IDAC_TAG_FILE_DESCRIPTION:
                    image.file_description = property_node.getAttribute("value")
                    continue
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py and 4 other locations - About 30 mins to fix
    ucsmsdk/utils/ccoimage.py on lines 174..177
    ucsmsdk/utils/ccoimage.py on lines 178..181
    ucsmsdk/utils/ccoimage.py on lines 182..185
    ucsmsdk/utils/ccoimage.py on lines 186..189

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 32.

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

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

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

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

    Refactorings

    Further Reading

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

                if property_node.getAttribute(
                        "name") == _UcsCcoImageList.IDAC_TAG_IP_URL:
                    image.ip_url = property_node.getAttribute("value")
                    continue
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py and 4 other locations - About 30 mins to fix
    ucsmsdk/utils/ccoimage.py on lines 174..177
    ucsmsdk/utils/ccoimage.py on lines 178..181
    ucsmsdk/utils/ccoimage.py on lines 182..185
    ucsmsdk/utils/ccoimage.py on lines 199..202

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 32.

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

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

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

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

    Refactorings

    Further Reading

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

                if property_node.getAttribute(
                        "name") == _UcsCcoImageList.IDAC_TAG_IMAGE_NAME:
                    image.image_name = property_node.getAttribute("value")
                    continue
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py and 4 other locations - About 30 mins to fix
    ucsmsdk/utils/ccoimage.py on lines 174..177
    ucsmsdk/utils/ccoimage.py on lines 182..185
    ucsmsdk/utils/ccoimage.py on lines 186..189
    ucsmsdk/utils/ccoimage.py on lines 199..202

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 32.

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

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

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

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

    Refactorings

    Further Reading

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

                if property_node.getAttribute(
                        "name") == _UcsCcoImageList.IDAC_TAG_URL:
                    image.url = property_node.getAttribute("value")
                    continue
    Severity: Major
    Found in ucsmsdk/utils/ccoimage.py and 4 other locations - About 30 mins to fix
    ucsmsdk/utils/ccoimage.py on lines 174..177
    ucsmsdk/utils/ccoimage.py on lines 178..181
    ucsmsdk/utils/ccoimage.py on lines 186..189
    ucsmsdk/utils/ccoimage.py on lines 199..202

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 32.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status