jacometoss/PyEWS

View on GitHub
electricalwiresizes/mbtcustd.py

Summary

Maintainability
F
4 days
Test Coverage

Function mbtcustd has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

def mbtcustd(Vcd=None,In=None,Nc=None,L=None,Class=None,Ta=None,Vd=None,View=None,Fsc=None, To=None, Break=None, Fcond=None):

    if(Vcd==None or In==None or Nc==None or L==None or Class==None or Ta==None or Vd==None or View==None or Fsc==None or To==None or Break==None or Fcond==None):
        t = time.localtime()
        print('''
Severity: Minor
Found in electricalwiresizes/mbtcustd.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

Consider simplifying this complex logical expression.
Open

    if(Vcd==None or In==None or Nc==None or L==None or Class==None or Ta==None or Vd==None or View==None or Fsc==None or To==None or Break==None or Fcond==None):
        t = time.localtime()
        print('''
                 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                                   
Severity: Critical
Found in electricalwiresizes/mbtcustd.py - About 2 hrs to fix

    Function mbtcustd has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def mbtcustd(Vcd=None,In=None,Nc=None,L=None,Class=None,Ta=None,Vd=None,View=None,Fsc=None, To=None, Break=None, Fcond=None):
    Severity: Major
    Found in electricalwiresizes/mbtcustd.py - About 1 hr to fix

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

                  if (To==60):
                      if ((round(datos[i][2],3)*FT60>=(In)) and (((round(datos[i][2],3))/In)>=Fcond)):
                          datos[i].append('Yes')
                      else:
                          datos[i].append('Not')
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 2 other locations - About 6 hrs to fix
      electricalwiresizes/mbtcustd.py on lines 118..122
      electricalwiresizes/mbtcustd.py on lines 123..127

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

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

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

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

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

      Refactorings

      Further Reading

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

                  elif (To==75):
                      if ((round(datos[i][3],3)*FT75>=(In)) and (((round(datos[i][3],3))/In)>=Fcond)):
                          datos[i].append('Yes')
                      else:
                          datos[i].append('Not')
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 2 other locations - About 6 hrs to fix
      electricalwiresizes/mbtcustd.py on lines 112..116
      electricalwiresizes/mbtcustd.py on lines 123..127

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

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

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

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

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

      Refactorings

      Further Reading

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

                  elif (To==90):
                      if ((round(datos[i][4],3)*FT90>=(In)) and (((round(datos[i][4],3))/In)>=Fcond)):
                          datos[i].append('Yes')
                      else:
                          datos[i].append('Not')
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 2 other locations - About 6 hrs to fix
      electricalwiresizes/mbtcustd.py on lines 112..116
      electricalwiresizes/mbtcustd.py on lines 118..122

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

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

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

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

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

      Refactorings

      Further Reading

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

          for i in range(len(dbConductorCuStd)):
               datos[i].append(dbConductorCuStd[i][4])
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 8 other locations - About 1 hr to fix
      electricalwiresizes/mbtal.py on lines 94..95
      electricalwiresizes/mbtal.py on lines 97..98
      electricalwiresizes/mbtal.py on lines 100..101
      electricalwiresizes/mbtcu.py on lines 99..100
      electricalwiresizes/mbtcu.py on lines 102..103
      electricalwiresizes/mbtcu.py on lines 105..106
      electricalwiresizes/mbtcustd.py on lines 91..92
      electricalwiresizes/mbtcustd.py on lines 94..95

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

          for i in range(len(dbConductorCuStd)):
               datos[i].append(dbConductorCuStd[i][6])
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 8 other locations - About 1 hr to fix
      electricalwiresizes/mbtal.py on lines 94..95
      electricalwiresizes/mbtal.py on lines 97..98
      electricalwiresizes/mbtal.py on lines 100..101
      electricalwiresizes/mbtcu.py on lines 99..100
      electricalwiresizes/mbtcu.py on lines 102..103
      electricalwiresizes/mbtcu.py on lines 105..106
      electricalwiresizes/mbtcustd.py on lines 88..89
      electricalwiresizes/mbtcustd.py on lines 91..92

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

          for i in range(len(dbConductorCuStd)):
               datos[i].append(dbConductorCuStd[i][5])
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 8 other locations - About 1 hr to fix
      electricalwiresizes/mbtal.py on lines 94..95
      electricalwiresizes/mbtal.py on lines 97..98
      electricalwiresizes/mbtal.py on lines 100..101
      electricalwiresizes/mbtcu.py on lines 99..100
      electricalwiresizes/mbtcu.py on lines 102..103
      electricalwiresizes/mbtcu.py on lines 105..106
      electricalwiresizes/mbtcustd.py on lines 88..89
      electricalwiresizes/mbtcustd.py on lines 94..95

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

              SITM=[0,15,20,30,40,50,60,70,80,90,100,110,125,150,175,200,225,250,300,350,400,450,500,600,700,800,1000,1200,1600,2000,2500,3000,4000,5000,6000]
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 1 other location - About 1 hr to fix
      electricalwiresizes/bd.py on lines 82..82

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

              datos[i].append(round(datos[i][2],3)*FT60)
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 2 other locations - About 1 hr to fix
      electricalwiresizes/mbtcustd.py on lines 108..108
      electricalwiresizes/mbtcustd.py on lines 109..109

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

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

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

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

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

      Refactorings

      Further Reading

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

              datos[i].append(round(datos[i][3],3)*FT75)
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 2 other locations - About 1 hr to fix
      electricalwiresizes/mbtcustd.py on lines 107..107
      electricalwiresizes/mbtcustd.py on lines 109..109

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

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

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

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

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

      Refactorings

      Further Reading

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

              datos[i].append(round(datos[i][4],3)*FT90)
      Severity: Major
      Found in electricalwiresizes/mbtcustd.py and 2 other locations - About 1 hr to fix
      electricalwiresizes/mbtcustd.py on lines 107..107
      electricalwiresizes/mbtcustd.py on lines 108..108

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

      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