jacometoss/PyEWS

View on GitHub

Showing 214 of 214 total issues

Function onJSONLoaded has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function onJSONLoaded () {
  data = JSON.parse(this.responseText);
  var scriptsToLoad = ['lunr.js'];
  if (data.config && data.config.lang && data.config.lang.length) {
    lang = data.config.lang;
Severity: Minor
Found in site/search/worker.js - 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 lexText has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

lunr.QueryLexer.lexText = function (lexer) {
  while (true) {
    var char = lexer.next()

    if (char == lunr.QueryLexer.EOS) {
Severity: Minor
Found in site/search/lunr.js - About 1 hr 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 2 locations. Consider refactoring.
      Open

                      dbcircuit[i].append(fct(carga[i][8],carga[i][14]))
      Severity: Major
      Found in electricalwiresizes/dbcircuit.py and 1 other location - About 1 hr to fix
      electricalwiresizes/dbcircuitcd.py on lines 54..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 44.

      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

                      dbcircuit[i].append(fct(carga[i][6],carga[i][10])) 
      Severity: Major
      Found in electricalwiresizes/dbcircuitcd.py and 1 other location - About 1 hr to fix
      electricalwiresizes/dbcircuit.py on lines 73..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 44.

      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 createFieldVectors has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      lunr.Builder.prototype.createFieldVectors = function () {
        var fieldVectors = {},
            fieldRefs = Object.keys(this.fieldTermFrequencies),
            fieldRefsLength = fieldRefs.length,
            termIdfCache = Object.create(null)
      Severity: Minor
      Found in site/search/lunr.js - About 1 hr to fix

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

            if (char == "^") {
              lexer.backup()
              if (lexer.width() > 0) {
                lexer.emit(lunr.QueryLexer.TERM)
              }
        Severity: Major
        Found in site/search/lunr.js and 1 other location - About 1 hr to fix
        site/search/lunr.js on lines 3154..3160

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

        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 (char == "~") {
              lexer.backup()
              if (lexer.width() > 0) {
                lexer.emit(lunr.QueryLexer.TERM)
              }
        Severity: Major
        Found in site/search/lunr.js and 1 other location - About 1 hr to fix
        site/search/lunr.js on lines 3162..3168

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

        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 tokenizer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        lunr.tokenizer = function (obj, metadata) {
          if (obj == null || obj == undefined) {
            return []
          }
        
        
        Severity: Minor
        Found in site/search/lunr.js - About 1 hr to fix

          Function parseEditDistance has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function parseBoost has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            lunr.QueryParser.parseBoost = function (parser) {
              var lexeme = parser.consumeLexeme()
            
              if (lexeme == undefined) {
                return
            Severity: Minor
            Found in site/search/lunr.js - 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

              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

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

                  for i in range(len(dbConductorAl)):
                       datos[i].append(dbConductorAl[i][9])
              Severity: Major
              Found in electricalwiresizes/mbtal.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/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

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

              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/bd.py and 1 other location - About 1 hr to fix
              electricalwiresizes/mbtcustd.py on lines 131..131

              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/distributioncu.py and 1 other location - About 1 hr to fix
              electricalwiresizes/distributional.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

              Severity
              Category
              Status
              Source
              Language