d4l3k/WebSync

View on GitHub

Showing 366 of 366 total issues

Function updateNav has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    updateNav: function() {
      var activeSection = $('.note-section:visible')[0];
      var activePage = $('.note-page:visible')[0];

      var sections = _.map($('.note-section'), function(section) {
Severity: Major
Found in assets/src/note.js - About 4 hrs to fix

    Function showTooltip has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            showTooltip : function(ChartElements, forceRedraw){
                // Only redraw the chart if we've actually changed what we're hovering on.
                if (typeof this.activeElements === 'undefined') this.activeElements = [];
    
                var isChanged = (function(Elements){
    Severity: Major
    Found in assets/lib/Chart.js - About 4 hrs to fix

      Function SupSub has 111 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var SupSub = P(MathCommand, function(_, super_) {
        _.ctrlSeq = '_{...}^{...}';
        _.createLeftOf = function(cursor) {
          if (!cursor[L] && cursor.options.supSubsRequireOperand) return;
          return super_.createLeftOf.apply(this, arguments);
      Severity: Major
      Found in assets/lib/mathquill.js - About 4 hrs to fix

        Function Tween has 111 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        TWEEN.Tween = function(a) {
            var c = {}, b = {}, d = {}, e = 1E3,
                g = 0,
                h = !1,
                j = !1,
        Severity: Major
        Found in assets/lib/tween.min.js - About 4 hrs to fix

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

          module.exports = function(ws, data) {
            ws.clientId = data.id;
            redis.get('websocket:key:' + data.id, function(err, reply) {
              //console.log(["Keys!", reply,data.key]);
              if (reply === data.key + ':' + ws.docId) {
          Severity: Major
          Found in lib/routes/auth.js - About 4 hrs to fix

            Function saneKeyboardEvents has 110 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var saneKeyboardEvents = (function() {
              // The following [key values][1] map was compiled from the
              // [DOM3 Events appendix section on key codes][2] and
              // [a widely cited report on cross-browser tests of key codes][3],
              // except for 10: 'Enter', which I've empirically observed in Safari on iOS
            Severity: Major
            Found in assets/lib/mathquill.js - About 4 hrs to fix

              File awesome.js has 347 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*global define, $, _, document, WebSyncAuth, WebSyncData, window, THREE, TWEEN,
                NProgress, JST, requestAnimationFrame*/
              
              //= require templates/awesome
              
              
              Severity: Minor
              Found in assets/src/awesome.js - About 4 hrs to fix

                Function applyPatch has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    applyPatch: function(patch, root, rootDom) {
                      var dom = rootDom.childNodes;
                      var exemptions = {};
                      _.each(patch, function(change) {
                        if (change.path.indexOf(root) === 0) {
                Severity: Major
                Found in assets/digest/core.js - About 4 hrs to fix

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

                            _.each(users, function(data, id) {
                              if ((new Date() - new Date(data.time)) > 60) {
                                delete users[id];
                                redis.publish('doc:' + ws.docId, JSON.stringify({
                                  type: 'client_bounce',
                  Severity: Major
                  Found in lib/routes/auth.js and 1 other location - About 4 hrs to fix
                  lib/routes/ping.js on lines 20..32

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

                  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

                      _.each(users, function(data, id) {
                        if ((new Date() - new Date(data.time)) > 60) {
                          delete users[id];
                          redis.publish('doc:' + ws.docId, JSON.stringify({
                            type: 'client_bounce',
                  Severity: Major
                  Found in lib/routes/ping.js and 1 other location - About 4 hrs to fix
                  lib/routes/auth.js on lines 87..99

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

                  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

                    try {
                      var mrow = v_subexpr_chain_to_mathml(tokens, {});
                      fix_mathvariant(mrow, null);
                  
                      mathml = document.createElementNS(mmlns, 'math');
                  Severity: Major
                  Found in assets/lib/display-latex.user.js and 1 other location - About 4 hrs to fix
                  assets/lib/display-latex.user.js on lines 1841..1854

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

                  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

                    try {
                      var mrow = v_subexpr_chain_to_mathml(tokens, {});
                      fix_mathvariant(mrow, null);
                  
                      mathml = document.createElementNS(mmlns, 'math');
                  Severity: Major
                  Found in assets/lib/display-latex.user.js and 1 other location - About 4 hrs to fix
                  assets/lib/display-latex.user.js on lines 1803..1816

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

                  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

                  File webdav.rb has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module WebSync
                    # WebDAV accessor methods for a WSFile.
                    class FileResource < DAV4Rack::Resource
                      include DAV4Rack::Utils
                      attr_accessor :file, :ws_user
                  Severity: Minor
                  Found in lib/webdav.rb - About 4 hrs to fix

                    Function tokenize_latex_math has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function tokenize_latex_math(input)
                    {
                      var result = new Array();
                      var in_text_mode = 0;
                      var brace_level = [];
                    Severity: Minor
                    Found in assets/lib/display-latex.user.js - About 4 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 convert has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                        convert: function(materialsInfo) {
                    
                            if (!this.options) return materialsInfo;
                    
                            var converted = {};
                    Severity: Minor
                    Found in assets/lib/MTL.js - About 3 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 2 locations. Consider refactoring.
                    Open

                                if (this.options.scaleOverride){
                                    helpers.extend(scaleOptions, {
                                        calculateYRange: helpers.noop,
                                        steps: this.options.scaleSteps,
                                        stepValue: this.options.scaleStepWidth,
                    Severity: Major
                    Found in assets/lib/Chart.js and 1 other location - About 3 hrs to fix
                    assets/lib/Chart.js on lines 2160..2168

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

                    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 (this.options.scaleOverride){
                                    helpers.extend(scaleOptions, {
                                        calculateYRange: helpers.noop,
                                        steps: this.options.scaleSteps,
                                        stepValue: this.options.scaleStepWidth,
                    Severity: Major
                    Found in assets/lib/Chart.js and 1 other location - About 3 hrs to fix
                    assets/lib/Chart.js on lines 2622..2630

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

                    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

                    File tween.min.js has 326 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // tween.js - http://github.com/sole/tween.js
                    'use strict';
                    void 0 === Date.now && (Date.now = function() {
                        return (new Date).valueOf()
                    });
                    Severity: Minor
                    Found in assets/lib/tween.min.js - About 3 hrs to fix

                      Function keystroke has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _.keystroke = function(key, e, ctrlr) {
                          var cursor = ctrlr.cursor;
                      
                          switch (key) {
                          case 'Ctrl-Shift-Backspace':
                      Severity: Major
                      Found in assets/lib/mathquill.js - About 3 hrs to fix

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

                          $('#encryptionModal #privkeyfile').on('change', function(e) {
                            var f = e.target.files[0];
                            var r = new FileReader();
                            r.onload = function(e) {
                              var contents = e.target.result;
                        Severity: Major
                        Found in assets/digest/crypto.js and 1 other location - About 3 hrs to fix
                        assets/digest/crypto.js on lines 66..74

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

                        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