d4l3k/WebSync

View on GitHub

Showing 192 of 366 total issues

Function renderObject has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var renderObject = function(object, camera) {

        if (object instanceof THREE.CSS3DObject) {

            var style;
Severity: Minor
Found in assets/lib/CSS3DRenderer.js - About 1 hr to fix

    Function createLeftOf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _.createLeftOf = function(cursor) {
        if (!this.replacedFragment) { // unless wrapping seln in brackets,
            // check if next to or inside an opposing one-sided bracket
            // (must check both sides 'cos I might be a pipe)
          var opts = cursor.options;
    Severity: Minor
    Found in assets/lib/mathquill.js - About 1 hr to fix

      Function patch_text has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function patch_text(node0)
      {
        var text = node0.nodeValue;
        var results = /\$[^$]+\$|\[tex\](.+?)\[\/tex\]/.exec(text);
      
      
      Severity: Minor
      Found in assets/lib/display-latex.user.js - About 1 hr to fix

        Function updateScaleRange has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                updateScaleRange: function(datapoints){
                    var valuesArray = [];
                    helpers.each(datapoints,function(segment){
                        valuesArray.push(segment.value);
                    });
        Severity: Minor
        Found in assets/lib/Chart.js - About 1 hr to fix

          Function RootMathCommand has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var RootMathCommand = P(MathCommand, function(_, super_) {
            _.init = function(cursor) {
              super_.init.call(this, '$');
              this.cursor = cursor;
            };
          Severity: Minor
          Found in assets/lib/mathquill.js - About 1 hr to fix

            Method copy has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def copy dest, overwrite=false
                  path = dest.path
                  # Enforce a '/' at the front.
                  if path[0] != "/"
                    path = "/"+path
            Severity: Minor
            Found in lib/webdav.rb - About 1 hr to fix

              Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function(ws, data) {
                var ids = [];
                postgres.query('SELECT asset_id FROM asset_ws_files WHERE file_id = $1', [ws.docId]).
                on('row', function(row) {
                  ids.push(row.asset_id);
              Severity: Minor
              Found in lib/routes/load_scripts.js - About 1 hr to fix

                Function v_matrix_to_mtable has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function v_matrix_to_mtable (tokens , v_mtable ) {
                 var v_mtr = result_element( "mtr" ,0) ;
                 var v_mtd = result_element( "mtd" ,0) ;
                 var v_token = tokens.list[tokens.index] ;
                 result_element_append( v_mtable , v_mtr );
                Severity: Minor
                Found in assets/lib/display-latex.user.js - About 1 hr to fix

                  Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function(ws, data) {
                    if (ws.authLevel === 'editor' || ws.authLevel === 'owner') {
                      var perms;
                      postgres.query('SELECT visibility, default_level FROM ws_files WHERE id = $1', [ws.docId]).
                      on('row', function(row) {
                  Severity: Minor
                  Found in lib/routes/permission_info.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                     if( ( ( tokens.list[tokens.length<=tokens.index+ 0 ? tokens.length-1 : tokens.index+ 0 ]
                    == "{" )  &&  ( tokens.list[tokens.length<=tokens.index+ 1 ? tokens.length-1 : tokens.index+ 1 ]
                    == "}" )  &&  ( ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]
                    == "_" )  ||  ( tokens.list[tokens.length<=tokens.index+ 2 ? tokens.length-1 : tokens.index+ 2 ]
                    == "^" ) ) ) ) {
                    Severity: Major
                    Found in assets/lib/display-latex.user.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (!this.replacedFragment) {
                            var leftward = cursor[L];
                            while (leftward &&
                              !(
                                leftward instanceof BinaryOperator ||
                      Severity: Major
                      Found in assets/lib/mathquill.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                            if (cursor.options.autoSubscriptNumerals
                                && cursor.parent !== cursor.parent.parent.sub
                                && ((cursor[L] instanceof Variable && cursor[L].isItalic !== false)
                                    || (cursor[L] instanceof SupSub
                                        && cursor[L][L] instanceof Variable
                        Severity: Major
                        Found in assets/lib/mathquill.js - About 1 hr to fix

                          Function createMaterial_ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              createMaterial_: function(materialName) {
                          
                                  // Create material
                          
                                  var mat = this.materialsInfo[materialName];
                          Severity: Minor
                          Found in assets/lib/MTL.js - About 55 mins 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 fix_mathvariant has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function fix_mathvariant(node, style)
                          {
                            if(node.nodeType == node.TEXT_NODE) {
                              if(style != null && style != '' && style in char_map) {
                                node.data = node.data.replace(uppercase_re,
                          Severity: Minor
                          Found in assets/lib/display-latex.user.js - About 55 mins 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 result_element has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function result_element(tag, num_attrs)
                          {
                            var node = document.createElementNS(mmlns, tag);
                          
                            var k = 2;
                          Severity: Minor
                          Found in assets/lib/display-latex.user.js - About 55 mins 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 v_read_delimiter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function v_read_delimiter (tokens ) {
                           var v_token = tokens.list[tokens.index] ;
                           if( ( v_token == null ) ) {
                            throw "unexpected eof" ;
                           }
                          Severity: Minor
                          Found in assets/lib/display-latex.user.js - About 55 mins 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 patch_text has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function patch_text(node0)
                          {
                            var text = node0.nodeValue;
                            var results = /\$[^$]+\$|\[tex\](.+?)\[\/tex\]/.exec(text);
                          
                          
                          Severity: Minor
                          Found in assets/lib/display-latex.user.js - About 45 mins 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

                          Avoid deeply nested control flow statements.
                          Open

                                                          for (var i=0;i<this.valuesCount;i++)
                                                          {
                                                              pointPosition = this.getPointPosition(i, this.calculateCenterOffset(this.min + (index * this.stepValue)));
                                                              if (i === 0){
                                                                  ctx.moveTo(pointPosition.x, pointPosition.y);
                          Severity: Major
                          Found in assets/lib/Chart.js - About 45 mins to fix

                            Function v_collect_invisible_group has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function v_collect_invisible_group (tokens , v_stop_tokens ) {
                             var v_result = v_subexpr_to_mathml (tokens ) ;
                             var v_mrow = null ;
                             while( ( ( tokens.list[tokens.index] != null )  &&  !( ( tokens.list[tokens.index] in v_stop_tokens ) )  &&  ( ( tokens.list[tokens.index] in g_named_identifiers
                            )  ||  ( tokens.list[tokens.index] in g_left_delimiters
                            Severity: Minor
                            Found in assets/lib/display-latex.user.js - About 45 mins 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

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (value[0] === 0 && value[1] === 0 && value[1] === 0) {
                            
                                                            // ignore
                            
                                                            save = false;
                            Severity: Major
                            Found in assets/lib/MTL.js - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language