jacometoss/PyEWS

View on GitHub

Showing 52 of 173 total issues

Function mbtal has a Cognitive Complexity of 180 (exceeds 5 allowed). Consider refactoring.
Open

def mbtal(VF=None,VL=None,In=None,Nc=None,L=None,FA=None,Type=None,Ta=None,Vd=None,S=None,Fp=None,View=None,Fsc=None,To=None, Break=None, Fcond=None):

    if(VF==None or VL==None or In==None or Nc==None or L==None or FA==None or Type==None or Ta==None or Vd==None or S==None or Fp==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/mbtal.py - About 3 days 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 mbtcu has a Cognitive Complexity of 180 (exceeds 5 allowed). Consider refactoring.
Open

def mbtcu(VF=None,VL=None,In=None,Nc=None,L=None,FA=None,Type=None,Ta=None,Vd=None,S=None,Fp=None,View=None,Fsc=None,To=None,Break=None, Fcond=None):

    if(VF==None or VL==None or In==None or Nc==None or L==None or FA==None or Type==None or Ta==None or Vd==None or S==None or Fp==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/mbtcu.py - About 3 days 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 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 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

Function dbcircuit has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def dbcircuit(carga=None,view=None,conductor=None, output=None):


    if(carga==None or view==None or conductor==None or output==None):
        t = time.localtime()
Severity: Minor
Found in electricalwiresizes/dbcircuit.py - About 4 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(VF==None or VL==None or In==None or Nc==None or L==None or FA==None or Type==None or Ta==None or Vd==None or S==None or Fp==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/mbtcu.py - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

        if(VF==None or VL==None or In==None or Nc==None or L==None or FA==None or Type==None or Ta==None or Vd==None or S==None or Fp==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/mbtal.py - About 4 hrs to fix

      Function redbtcu has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      def  redbtcu(network=None,conductors=None,view=None):
      
          if(network==None or conductors==None  or view==None):
              t = time.localtime()
              print('''
      Severity: Minor
      Found in electricalwiresizes/distributioncu.py - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function redbtal has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      def  redbtal(network=None,conductors=None,view=None):
      
          if(network==None or conductors==None  or view==None):
              t = time.localtime()
              print('''
      Severity: Minor
      Found in electricalwiresizes/distributional.py - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function sistemaIn has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      def sistemaIn(Data,i):
         
          if Data[i][2]=="1F/2H":
              if (Data[i][5])==0:
                  In=0
      Severity: Minor
      Found in electricalwiresizes/basicelecfunc.py - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      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

        File basicelecfunc.py has 267 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import math, time
        from tabulate import tabulate
        from .bd import dbConductorCu, dbConductorAl, dbConductorCuStd
        
        def Rn(Ra=None,T2=None):
        Severity: Minor
        Found in electricalwiresizes/basicelecfunc.py - About 2 hrs to fix

          Function graph has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          def graph(mydata=None,condA=None,condB=None,w=None,h=None,material=None,color=None,sistema=None, vd=None):
          
          
              if((mydata==None or not mydata) or condA==None or condB==None or w==None or h==None or material==None or color==None or sistema==None or vd==None):
                  t = time.localtime()
          Severity: Minor
          Found in electricalwiresizes/graph.py - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function mbtal has 16 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def mbtal(VF=None,VL=None,In=None,Nc=None,L=None,FA=None,Type=None,Ta=None,Vd=None,S=None,Fp=None,View=None,Fsc=None,To=None, Break=None, Fcond=None):
          Severity: Major
          Found in electricalwiresizes/mbtal.py - About 2 hrs to fix

            Function mbtcu has 16 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def mbtcu(VF=None,VL=None,In=None,Nc=None,L=None,FA=None,Type=None,Ta=None,Vd=None,S=None,Fp=None,View=None,Fsc=None,To=None,Break=None, Fcond=None):
            Severity: Major
            Found in electricalwiresizes/mbtcu.py - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                  if((mydata==None or not mydata) or condA==None or condB==None or w==None or h==None or material==None or color==None or sistema==None or vd==None):
                      t = time.localtime()
                      print('''
                               :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                                                 
              Severity: Critical
              Found in electricalwiresizes/graph.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

                  Function dbcircuitcd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def dbcircuitcd(carga=None,view=None):
                  
                      if(carga==None or view==None):
                          t = time.localtime()
                          print('''
                  Severity: Minor
                  Found in electricalwiresizes/dbcircuitcd.py - About 1 hr to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function zpual has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def zpual(Type=None,Ta=None,Fp=None,View=None):
                  
                      if(Type==None or Ta==None or Fp==None or View==None):
                          t = time.localtime()
                          print('''
                  Severity: Minor
                  Found in electricalwiresizes/basicelecfunc.py - About 1 hr to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function zpucu has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def zpucu(Type=None,Ta=None,Fp=None,View=None):
                  
                      if(Type==None or Ta==None or Fp==None or View==None):
                          t = time.localtime()
                          print('''
                  Severity: Minor
                  Found in electricalwiresizes/basicelecfunc.py - About 1 hr to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language