jacometoss/PyEWS

View on GitHub

Showing 214 of 214 total issues

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

    for i in range(len(dbConductorAl)):
         datos[i].append(dbConductorAl[i][7])
Severity: Major
Found in electricalwiresizes/mbtal.py and 8 other locations - About 1 hr to fix
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
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

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

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

    for i in range(len(dbConductorCu)):
         datos[i].append(dbConductorCu[i][9])
Severity: Major
Found in electricalwiresizes/mbtcu.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/mbtcustd.py on lines 88..89
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(dbConductorCu)):
         datos[i].append(dbConductorCu[i][8])
Severity: Major
Found in electricalwiresizes/mbtcu.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 105..106
electricalwiresizes/mbtcustd.py on lines 88..89
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(dbConductorCu)):
         datos[i].append(dbConductorCu[i][7])
Severity: Major
Found in electricalwiresizes/mbtcu.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 102..103
electricalwiresizes/mbtcu.py on lines 105..106
electricalwiresizes/mbtcustd.py on lines 88..89
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 2 locations. Consider refactoring.
Open

    if(network==None or conductors==None  or view==None):
        t = time.localtime()
        print('''
                 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
                                
Severity: Major
Found in electricalwiresizes/distributional.py and 1 other location - About 1 hr to fix
electricalwiresizes/distributioncu.py on lines 8..27

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

Function positionForIndex has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

lunr.Vector.prototype.positionForIndex = function (index) {
  // For an empty vector the tuple can be inserted at the beginning
  if (this.elements.length == 0) {
    return 0
  }
Severity: Minor
Found in site/search/lunr.js - About 1 hr to fix

    Function onScriptsLoaded has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function onScriptsLoaded () {
      console.log('All search scripts loaded, building Lunr index...');
      if (data.config && data.config.separator && data.config.separator.length) {
        lunr.tokenizer.separator = new RegExp(data.config.separator);
      }
    Severity: Minor
    Found in site/search/worker.js - About 1 hr to fix

      Function parseTerm has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      lunr.QueryParser.parseTerm = function (parser) {
        var lexeme = parser.consumeLexeme()
      
        if (lexeme == undefined) {
          return
      Severity: Minor
      Found in site/search/lunr.js - About 1 hr to fix

        Function load has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        lunr.Index.load = function (serializedIndex) {
          var attrs = {},
              fieldVectors = {},
              serializedVectors = serializedIndex.fieldVectors,
              invertedIndex = Object.create(null),
        Severity: Minor
        Found in site/search/lunr.js - About 1 hr to fix

          Function parsePresence has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          lunr.QueryParser.parsePresence = function (parser) {
            var lexeme = parser.consumeLexeme()
          
            if (lexeme == undefined) {
              return
          Severity: Minor
          Found in site/search/lunr.js - About 1 hr to fix

            Function graph has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def graph(mydata=None,condA=None,condB=None,w=None,h=None,material=None,color=None,sistema=None, vd=None):
            Severity: Major
            Found in electricalwiresizes/graph.py - About 1 hr to fix

              Function insert has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              lunr.TokenSet.Builder.prototype.insert = function (word) {
                var node,
                    commonPrefix = 0
              
                if (word < this.previousWord) {
              Severity: Minor
              Found in site/search/lunr.js - About 1 hr to fix

                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

                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

                Avoid deeply nested control flow statements.
                Open

                                    if ((round(datos[i][5],3)*FA*FT60>=In) and (((round(datos[i][5],3))/In)>=Fcond)):
                                        datos[i].append('Yes')
                                    else:
                                        datos[i].append('Not')
                
                Severity: Major
                Found in electricalwiresizes/mbtal.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if ((round(datos[i][6],3)*FA*FT75>=(In)) and (((round(datos[i][6],3))/In)>=Fcond)):
                                          datos[i].append('Yes')
                                      else:
                                          datos[i].append('Not')
                  
                  Severity: Major
                  Found in electricalwiresizes/mbtcu.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if (network[i][2]==iDAlm[k]):
                                            #Zpu se complementa
                                            dtb[i].append(conductors[j][k])
                                            #print (datos[j][k])
                        #print ("-------------------------------------")                     
                    Severity: Major
                    Found in electricalwiresizes/distributioncu.py - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language