d4l3k/WebSync

View on GitHub

Showing 192 of 366 total issues

Function animationLoop has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        animationLoop = helpers.animationLoop = function(callback,totalSteps,easingString,onProgress,onComplete,chartInstance){
Severity: Minor
Found in assets/lib/Chart.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (pointPosition.x - textWidth < furthestLeft) {
                            furthestLeft = pointPosition.x - textWidth;
                            furthestLeftIndex = i;
                        }
    Severity: Major
    Found in assets/lib/Chart.js - About 45 mins to fix

      Function drawRoundedRectangle has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              drawRoundedRectangle = helpers.drawRoundedRectangle = function(ctx,x,y,width,height,radius){
      Severity: Minor
      Found in assets/lib/Chart.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if (dir === L) children.adopt(dest, dest.ends[R], 0);
                    else children.adopt(dest, 0, dest.ends[L]);
        Severity: Major
        Found in assets/lib/mathquill.js - About 45 mins to fix

          Method make_collection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def make_collection
                raise Conflict unless parent.exist?
                if request.body.read.to_s == ''
                  if exist?
                    MethodNotAllowed
          Severity: Minor
          Found in lib/webdav.rb - 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 (callback) {
                        callback(data.property, data.value, data.space);
                        delete WebSync._configCallbacks[data.id];
                      }
          Severity: Major
          Found in assets/digest/core.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      } else if (change.op === 'add') {
                        var cur = dom;
                        var tree = [rootDom, dom];
                        _.each(parts.slice(0, -1), function(part) {
                          cur = cur[part];
            Severity: Major
            Found in assets/digest/core.js - About 45 mins to fix

              Method update_login_methods has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      def update_login_methods user
                        provider_list = get_selected_providers
                        provider_string = provider_list.join(",")
                        if provider_list.empty?
                          flash.now[:danger] = "You have to specify a login method."
              Severity: Minor
              Found in lib/routes/settings.rb - 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

                      } else if (data.type === 'info') {
                        WebSync.webSocketFirstTime = false;
                        WebSync.loadScripts();
                        WebSync.connection.sendJSON({
                          type: 'config',
              Severity: Major
              Found in assets/digest/core.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if (change.value === '#text') {
                                el = document.createTextNode('');
                              } else {
                                el = document.createElement(change.value);
                                var attrs = cur.attributes;
                Severity: Major
                Found in assets/digest/core.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (data.action === 'sync') {
                              var elem = WebSync.error('<b>Error</b> ' + data.reason + ' Click to force changes.');
                              $(elem).click(function() {
                                $(this).hide();
                                WebSync.info('Attempting to force changes...');
                  Severity: Major
                  Found in assets/digest/core.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if (last === 'textContent') {
                                  cur[last] = '';
                    
                                  // Remove all children
                                } else if (last === 'childNodes') {
                    Severity: Major
                    Found in assets/digest/core.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if (parent.css('text-indent') === '0px') {
                                  if (parent.attr('contenteditable') === 'true') {
                                    node.wrap("<div style='text-indent: 40px'></div>");
                                  } else {
                                    parent.css({
                      Severity: Major
                      Found in assets/digest/edit.js - About 45 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                          else if(node.nodeType == node.ELEMENT_NODE) {    if(node.tagName == 'TEXTAREA' || node.tagName == 'textarea' ||
                               node.tagName == 'INPUT' || node.tagName == 'input' ||
                               node.tagName == 'SCRIPT' || node.tagName == 'script')
                              return;
                        Severity: Major
                        Found in assets/lib/display-latex.user.js - About 40 mins to fix

                          Function init has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            _.init = function(side, open, close, ctrlSeq, end) {
                          Severity: Minor
                          Found in assets/lib/mathquill.js - About 35 mins to fix

                            Function calculateScaleRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    calculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){
                            Severity: Minor
                            Found in assets/lib/Chart.js - About 35 mins to fix

                              Function CatmullRom has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      CatmullRom: function(a, c, b, d, e) {
                              Severity: Minor
                              Found in assets/lib/tween.min.js - About 35 mins to fix

                                Function load has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    load: function(url, mtlurl, onLoad, onProgress, onError) {
                                Severity: Minor
                                Found in assets/lib/MTL.js - About 35 mins to fix

                                  Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def initialize(public_path, path, request, response, options)
                                  Severity: Minor
                                  Found in lib/webdav.rb - About 35 mins to fix

                                    Function v_matrix_to_mathml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function v_matrix_to_mathml (tokens , v_open_delim , v_close_delim ) {
                                     var v_mtable = v_matrix_to_mtable (tokens , result_element( "mtable" ,0) ) ;
                                     if( ( ( v_open_delim != null )  ||  ( v_close_delim != null ) ) ) {
                                      var v_mrow = result_element( "mrow" ,0) ;
                                      if( ( v_open_delim != null ) ) {
                                    Severity: Minor
                                    Found in assets/lib/display-latex.user.js - About 35 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language