d4l3k/WebSync

View on GitHub

Showing 192 of 366 total issues

Function CSS3DRenderer has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

THREE.CSS3DRenderer = function() {

    console.log('THREE.CSS3DRenderer', THREE.REVISION);

    var _width, _height;
Severity: Major
Found in assets/lib/CSS3DRenderer.js - About 4 hrs to fix

    File crypto.js has 359 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*jslint browser: true*/
    /*global define, $, _, openpgp, JST, WebSyncAuth, WebSyncData, WS, moment*/
    
    //= require templates/crypto
    
    
    Severity: Minor
    Found in assets/digest/crypto.js - About 4 hrs to fix

      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

                      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

                        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

                            Function makeChart has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                makeChart: function(container, options, size) {
                                  var chart = $('<div class="Chart resizable" contenteditable="false">' +
                                    (options.chartTitle ? '<h2>' + _.escape(options.chartTitle) + '</h2>' : '') +
                                    '<h3 class="y">' + _.escape(options.chartYTitle) + '</h3>' +
                                    '<canvas class="noresize"></canvas>' +
                            Severity: Major
                            Found in assets/src/charts.js - About 3 hrs to fix

                              Function Node has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              var Node = P(function(_) {
                                _[L] = 0;
                                _[R] = 0
                                _.parent = 0;
                              
                              
                              Severity: Major
                              Found in assets/lib/mathquill.js - About 3 hrs to fix

                                Function draw has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        draw: function(){
                                            if (this.display){
                                                var ctx = this.ctx;
                                                each(this.yLabels, function(label, index){
                                                    // Don't draw a centre value
                                Severity: Major
                                Found in assets/lib/Chart.js - About 3 hrs to fix

                                  Class FileResource has 29 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                    class FileResource < DAV4Rack::Resource
                                      include DAV4Rack::Utils
                                      attr_accessor :file, :ws_user
                                  
                                      # Represents the root directory. It might be a good idea to change this to be
                                  Severity: Minor
                                  Found in lib/webdav.rb - About 3 hrs to fix

                                    Function Fragment has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    var Fragment = P(function(_) {
                                      _.init = function(withDir, oppDir, dir) {
                                        if (dir === undefined) dir = L;
                                        prayDirection(dir);
                                    
                                    
                                    Severity: Major
                                    Found in assets/lib/mathquill.js - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language