jacometoss/PyEWS

View on GitHub
electricalwiresizes/shortcircuit.py

Summary

Maintainability
F
2 wks
Test Coverage

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

def icc(conductor=None,T1=None,T2=None,fhz=None,view=None):

    if((conductor==None or T1==None or T2==None or fhz==None or view==None)):
        t = time.localtime()
        print('''
Severity: Minor
Found in electricalwiresizes/shortcircuit.py - About 7 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

def icc(conductor=None,T1=None,T2=None,fhz=None,view=None):
Severity: Minor
Found in electricalwiresizes/shortcircuit.py - About 35 mins to fix

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorAl[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorAl[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157

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

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorAl[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorAl[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorAl[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorAl[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorAl)):
                CM=round(dbConductorAl[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 67..69
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

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

            for i in range(len(dbConductorCu)):
                CM=round(dbConductorCu[i][10]*1973.525241,2)
                datos[i].append(round(math.sqrt(((pow(CM,2)*(k*math.log10((T2+234)/(T1+234)))))/t)/1000,2))
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 15 other locations - About 7 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 57..59
    electricalwiresizes/shortcircuit.py on lines 62..64
    electricalwiresizes/shortcircuit.py on lines 71..73
    electricalwiresizes/shortcircuit.py on lines 76..78
    electricalwiresizes/shortcircuit.py on lines 81..83
    electricalwiresizes/shortcircuit.py on lines 86..88
    electricalwiresizes/shortcircuit.py on lines 91..93
    electricalwiresizes/shortcircuit.py on lines 126..128
    electricalwiresizes/shortcircuit.py on lines 131..133
    electricalwiresizes/shortcircuit.py on lines 136..138
    electricalwiresizes/shortcircuit.py on lines 140..142
    electricalwiresizes/shortcircuit.py on lines 145..147
    electricalwiresizes/shortcircuit.py on lines 150..152
    electricalwiresizes/shortcircuit.py on lines 155..157
    electricalwiresizes/shortcircuit.py on lines 160..162

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

    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

            datos=[["14 AWG"],
                ["12 AWG"],
                ["10 AWG"],
                ["8 AWG"],
                ["6 AWG"],
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 1 other location - About 3 hrs to fix
    electricalwiresizes/mbtcu.py on lines 55..73

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

    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 view==1:
                headers = ["Calibre","S[mm²]","1C[kA]","2C[kA]","4C[kA]", "8C[kA]", "16C[kA]", "30C[kA]", "60C[kA]", "100C[kA]"]
                print(tabulate(datos, headers, tablefmt="pretty"))
            elif view==2:
                return datos
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 1 other location - About 2 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 95..99

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

    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 view==1:
                headers = ["Calibre","S[mm²]","1C[kA]","2C[kA]","4C[kA]", "8C[kA]", "16C[kA]", "30C[kA]", "60C[kA]", "100C[kA]"]
                print(tabulate(datos, headers, tablefmt="pretty"))
            elif view==2:
                return datos
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 1 other location - About 2 hrs to fix
    electricalwiresizes/shortcircuit.py on lines 164..168

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

    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

            datos=[["6 AWG"],
                ["4 AWG"],
                ["2 AWG"],
                ["1/0 AWG"],
                ["2/0 AWG"],
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 1 other location - About 2 hrs to fix
    electricalwiresizes/mbtal.py on lines 53..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 51.

    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 i in range(len(dbConductorAl)):
                Seccion=dbConductorAl[i][10]
                datos[i].append(Seccion)
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 1 other location - About 1 hr to fix
    electricalwiresizes/shortcircuit.py on lines 52..54

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

    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 i in range(len(dbConductorCu)):
                Seccion=dbConductorCu[i][10]
                datos[i].append(Seccion)
    Severity: Major
    Found in electricalwiresizes/shortcircuit.py and 1 other location - About 1 hr to fix
    electricalwiresizes/shortcircuit.py on lines 121..123

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

    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