jacometoss/PyEWS

View on GitHub

Showing 83 of 214 total issues

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

    lunr.Builder.prototype.add = function (doc, attributes) {
      var docRef = doc[this._ref],
          fields = Object.keys(this._fields)
    
      this._documents[docRef] = attributes || {}
    Severity: Minor
    Found in site/search/lunr.js - About 1 hr to fix

      Function intersect has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      lunr.TokenSet.prototype.intersect = function (b) {
        var output = new lunr.TokenSet,
            frame = undefined
      
        var stack = [{
      Severity: Minor
      Found in site/search/lunr.js - About 1 hr to fix

        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

            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

              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

                    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

                    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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language