puffer/puffer_pages

View on GitHub

Showing 177 of 219 total issues

Function CodeMirror has a Cognitive Complexity of 2984 (exceeds 5 allowed). Consider refactoring.
Open

window.CodeMirror = (function() {
  "use strict";

  // BROWSER SNIFFING

Severity: Minor
Found in app/assets/javascripts/puffer/codemirror.js - About 2 mos 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 CodeMirror has 3916 lines of code (exceeds 25 allowed). Consider refactoring.
Open

window.CodeMirror = (function() {
  "use strict";

  // BROWSER SNIFFING

Severity: Major
Found in app/assets/javascripts/puffer/codemirror.js - About 2 wks to fix

    File codemirror.js has 3919 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // CodeMirror version 3.01
    //
    // CodeMirror is the only global var we claim
    window.CodeMirror = (function() {
      "use strict";
    Severity: Major
    Found in app/assets/javascripts/puffer/codemirror.js - About 1 wk to fix

      Function Tabs has a Cognitive Complexity of 275 (exceeds 5 allowed). Consider refactoring.
      Open

      var Tabs = RightJS.Tabs = (function(document, parseInt, RightJS) {
      /**
       * This module defines the basic widgets constructor
       * it creates an abstract proxy with the common functionality
       * which then we reuse and override in the actual widgets
      Severity: Minor
      Found in app/assets/javascripts/puffer/right-tabs-src.js - About 5 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 Tabs has 638 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Tabs = RightJS.Tabs = (function(document, parseInt, RightJS) {
      /**
       * This module defines the basic widgets constructor
       * it creates an abstract proxy with the common functionality
       * which then we reuse and override in the actual widgets
      Severity: Major
      Found in app/assets/javascripts/puffer/right-tabs-src.js - About 3 days to fix

        Function multiplexingMode has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
        Open

        CodeMirror.multiplexingMode = function(outer /*, others */) {
          // Others should be {open, close, mode [, delimStyle]} objects
          var others = Array.prototype.slice.call(arguments, 1);
          var n_others = others.length;
        
        
        Severity: Minor
        Found in app/assets/javascripts/puffer/multiplex.js - About 1 day 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 right-tabs-src.js has 640 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Tabs widget for RightJS (http://rightjs.org/ui/tabs)
         *
         * Copyright (C) 2009-2010 Nikolay Nemshilov
         */
        Severity: Major
        Found in app/assets/javascripts/puffer/right-tabs-src.js - About 1 day to fix

          File css.js has 392 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          CodeMirror.defineMode("css", function(config) {
            var indentUnit = config.indentUnit, type;
            
            var atMediaTypes = keySet([
              "all", "aural", "braille", "handheld", "print", "projection", "screen",
          Severity: Minor
          Found in app/assets/javascripts/puffer/codemirror/css.js - About 5 hrs to fix

            File javascript.js has 370 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // TODO actually recognize syntax of TypeScript constructs
            
            CodeMirror.defineMode("javascript", function(config, parserConfig) {
              var indentUnit = config.indentUnit;
              var jsonMode = parserConfig.json;
            Severity: Minor
            Found in app/assets/javascripts/puffer/codemirror/javascript.js - About 4 hrs to fix

              Function onMouseDown has 114 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function onMouseDown(e) {
                  var cm = this, display = cm.display, view = cm.view, sel = view.sel, doc = view.doc;
                  sel.shift = e_prop(e, "shiftKey");
              
                  if (eventInWidget(display, e)) {
              Severity: Major
              Found in app/assets/javascripts/puffer/codemirror.js - About 4 hrs to fix

                Function updateDocNoUndo has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function updateDocNoUndo(cm, from, to, lines, selUpdate, origin) {
                    var view = cm.view, doc = view.doc, display = cm.display;
                    if (view.suppressEdits) return;
                
                    var nlines = to.line - from.line, firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
                Severity: Major
                Found in app/assets/javascripts/puffer/codemirror.js - About 4 hrs to fix

                  Class Page has 31 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PufferPages::Backends::Page < ActiveRecord::Base
                    include ActiveUUID::UUID
                    include PufferPages::Backends::Mixins::Renderable
                    include PufferPages::Backends::Mixins::Importable
                    include PufferPages::Backends::Mixins::Localable
                  Severity: Minor
                  Found in lib/puffer_pages/backends/models/page.rb - About 3 hrs to fix

                    Function bidiOrdering has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var bidiOrdering = (function() {
                        // Character types for codepoints 0 to 0xff
                        var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";
                        // Character types for codepoints 0x600 to 0x6ff
                        var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";
                    Severity: Major
                    Found in app/assets/javascripts/puffer/codemirror.js - About 3 hrs to fix

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

                          token: function(stream, state) {
                            
                            // Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
                            // 
                            // rule** or **ruleset:
                      Severity: Major
                      Found in app/assets/javascripts/puffer/codemirror/css.js - About 3 hrs to fix

                        Function multiplexingMode has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        CodeMirror.multiplexingMode = function(outer /*, others */) {
                          // Others should be {open, close, mode [, delimStyle]} objects
                          var others = Array.prototype.slice.call(arguments, 1);
                          var n_others = others.length;
                        
                        
                        Severity: Major
                        Found in app/assets/javascripts/puffer/multiplex.js - About 3 hrs to fix

                          File xml.js has 306 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          CodeMirror.defineMode("xml", function(config, parserConfig) {
                            var indentUnit = config.indentUnit;
                            var Kludges = parserConfig.htmlMode ? {
                              autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
                                                'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
                          Severity: Minor
                          Found in app/assets/javascripts/puffer/codemirror/xml.js - About 3 hrs to fix

                            Function updateDisplayInner has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function updateDisplayInner(cm, changes, viewPort) {
                                var display = cm.display, doc = cm.view.doc;
                                if (!display.wrapper.clientWidth) {
                                  display.showingFrom = display.showingTo = display.viewOffset = 0;
                                  return;
                            Severity: Major
                            Found in app/assets/javascripts/puffer/codemirror.js - About 3 hrs to fix

                              Function charOrdering has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  return function charOrdering(str) {
                                    if (!bidiRE.test(str)) return false;
                                    var len = str.length, types = [];
                                    for (var i = 0, type; i < len; ++i)
                                      types.push(type = charType(str.charCodeAt(i)));
                              Severity: Major
                              Found in app/assets/javascripts/puffer/codemirror.js - About 3 hrs to fix

                                Function resizing has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  resizing: function(callback) {
                                    var controller = this.tab.main;
                                
                                    if (controller.__working) { return this.resizing.bind(this, callback).delay(100); }
                                
                                
                                Severity: Major
                                Found in app/assets/javascripts/puffer/right-tabs-src.js - About 3 hrs to fix

                                  Function registerEventHandlers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function registerEventHandlers(cm) {
                                      var d = cm.display;
                                      on(d.scroller, "mousedown", operation(cm, onMouseDown));
                                      on(d.scroller, "dblclick", operation(cm, e_preventDefault));
                                      on(d.lineSpace, "selectstart", function(e) {
                                  Severity: Major
                                  Found in app/assets/javascripts/puffer/codemirror.js - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language