d4l3k/WebSync

View on GitHub

Showing 366 of 366 total issues

File mathquill.js has 3762 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * MathQuill: http://mathquill.com
 * by Jay and Han (laughinghan@gmail.com)
 *
 * This Source Code Form is subject to the terms of the
Severity: Major
Found in assets/lib/mathquill.js - About 1 wk to fix

    File Chart.js has 2512 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Chart.js
     * http://chartjs.org/
     * Version: 1.0.1-beta.4
     *
    Severity: Major
    Found in assets/lib/Chart.js - About 1 wk to fix

      File display-latex.user.js has 1766 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // This script was automatically generated from a literate source.
      // Do not edit this file; look at the literate source instead!
      //
      // Greasemonkey user script to
      // Display LaTeX in Web pages by transforming to MathML
      Severity: Major
      Found in assets/lib/display-latex.user.js - About 4 days to fix

        File core.js has 1335 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*jslint browser: true*/
        /*global $, define, rangy, _, Detector, WebSyncData, ace, WebSyncAuth, WebSocket, jsonpatch, openpgp, NProgress, fullScreenApi, requirejs, WS*/
        
        /*
          WebSync: Core.js
        Severity: Major
        Found in assets/digest/core.js - About 3 days to fix

          File tables.js has 848 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          /*global $, define, rangy, _, JST*/
          
          //= require templates/tables-ribbon
          //= require templates/tables-selection
          Severity: Major
          Found in assets/src/tables.js - About 2 days to fix

            Function v_subexpr_to_mathml has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
            Open

            function v_subexpr_to_mathml (tokens ) {
             var v_result = null ;
             var v_mmultiscripts = null ;
             var v_mprescripts = null ;
             if( ( ( tokens.list[tokens.length<=tokens.index+ 0 ? tokens.length-1 : tokens.index+ 0 ]
            Severity: Minor
            Found in assets/lib/display-latex.user.js - About 2 days 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 matrix has 292 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            LatexCmds.matrix = P(MathCommand, function(_, super_) {
            
              var MatrixCell = P(MathBlock, function(_, super_) {
                _.init = function (column, row) {
                  this.column = column;
            Severity: Major
            Found in assets/lib/mathquill.js - About 1 day to fix

              Function onmessage has 229 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    onmessage: function(e) {
                      var data = JSON.parse(e.data);
                      console.log('MESSAGE', data);
                      var events = WS.registeredMessageEvents[data.type];
                      if (!_.isEmpty(events)) {
              Severity: Major
              Found in assets/digest/core.js - About 1 day to fix

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

                 while( ( ( 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 and 2 other locations - About 1 day to fix
                assets/lib/display-latex.user.js on lines 1323..1359
                assets/lib/display-latex.user.js on lines 1331..1358

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

                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

                 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 and 2 other locations - About 1 day to fix
                assets/lib/display-latex.user.js on lines 1331..1358
                assets/lib/display-latex.user.js on lines 1402..1437

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

                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

                  while( ( ( 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 and 2 other locations - About 1 day to fix
                assets/lib/display-latex.user.js on lines 1323..1359
                assets/lib/display-latex.user.js on lines 1402..1437

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

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

                var Cursor = P(Point, function(_) {
                  _.init = function(initParent, options) {
                    this.parent = initParent;
                    this.options = options;
                
                
                Severity: Major
                Found in assets/lib/mathquill.js - About 7 hrs to fix

                  Function Tween has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                  Open

                  TWEEN.Tween = function(a) {
                      var c = {}, b = {}, d = {}, e = 1E3,
                          g = 0,
                          h = !1,
                          j = !1,
                  Severity: Minor
                  Found in assets/lib/tween.min.js - About 7 hrs 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 parse has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                  Open

                      parse: function(data, mtllibCallback) {
                  
                          function vector(x, y, z) {
                  
                              return new THREE.Vector3(x, y, z);
                  Severity: Minor
                  Found in assets/lib/MTL.js - About 6 hrs 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 3 locations. Consider refactoring.
                  Open

                              if (this.options.showTooltips){
                                  helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                      var activePoints = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];
                                      this.eachPoints(function(point){
                                          point.restore(['fillColor', 'strokeColor']);
                  Severity: Major
                  Found in assets/lib/Chart.js and 2 other locations - About 6 hrs to fix
                  assets/lib/Chart.js on lines 2016..2029
                  assets/lib/Chart.js on lines 3119..3133

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

                  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

                              if (this.options.showTooltips){
                                  helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                      var activeBars = (evt.type !== 'mouseout') ? this.getBarsAtEvent(evt) : [];
                  
                                      this.eachBars(function(bar){
                  Severity: Major
                  Found in assets/lib/Chart.js and 2 other locations - About 6 hrs to fix
                  assets/lib/Chart.js on lines 2493..2505
                  assets/lib/Chart.js on lines 3119..3133

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

                  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

                              if (this.options.showTooltips){
                                  helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                      var activePointsCollection = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];
                  
                                      this.eachPoints(function(point){
                  Severity: Major
                  Found in assets/lib/Chart.js and 2 other locations - About 6 hrs to fix
                  assets/lib/Chart.js on lines 2016..2029
                  assets/lib/Chart.js on lines 2493..2505

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

                  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

                  g_tex_commands has 47 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  = { "\\frac" : v_fraction_to_mathml ,
                  "\\dfrac" : v_fraction_to_mathml ,
                  "\\tfrac" : v_fraction_to_mathml ,
                  "\\binom" : v_binom_to_mathml ,
                  "\\sqrt" : v_sqrt_to_mathml ,
                  Severity: Minor
                  Found in assets/lib/display-latex.user.js - About 6 hrs to fix

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

                                var scaleSizes = (this.options.scaleOverride) ?
                                    {
                                        steps: this.options.scaleSteps,
                                        stepValue: this.options.scaleStepWidth,
                                        min: this.options.scaleStartValue,
                    Severity: Major
                    Found in assets/lib/Chart.js and 1 other location - About 6 hrs to fix
                    assets/lib/Chart.js on lines 3255..3268

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

                    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

                                var scaleSizes = (this.options.scaleOverride) ?
                                    {
                                        steps: this.options.scaleSteps,
                                        stepValue: this.options.scaleStepWidth,
                                        min: this.options.scaleStartValue,
                    Severity: Major
                    Found in assets/lib/Chart.js and 1 other location - About 6 hrs to fix
                    assets/lib/Chart.js on lines 2954..2967

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

                    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