codeforamerica/oakland_answers

View on GitHub

Showing 44 of 97 total issues

File bootstrap.js has 1517 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#transitions
 * ===================================================
 * Copyright 2013 Twitter, Inc.
Severity: Major
Found in app/assets/javascripts/bootstrap.js - About 4 days to fix

    File Markdown.Editor.js has 1512 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // needs Markdown.Converter.js at the moment
    
    (function () {
    
        var util = {},
    Severity: Major
    Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 4 days to fix

      Function Converter has 430 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Markdown.Converter = function () {
              var pluginHooks = this.hooks = new HookCollection();
              pluginHooks.addNoop("plainLinkText");  // given a URL that was encountered by itself (without markup), should return the link text that's to be given to this link
              pluginHooks.addNoop("preConversion");  // called with the orignal text as given to makeHtml. The result of this plugin hook is the actual markdown source that will be cooked
              pluginHooks.addNoop("postConversion"); // called with the final cooked HTML code. The result of this plugin hook is the actual output of makeHtml
      Severity: Major
      Found in app/assets/javascripts/pagedown/Markdown.Converter.js - About 2 days to fix

        Function UIManager has 237 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function UIManager(postfix, panels, undoManager, previewManager, commandManager, helpOptions, getString) {
        
                var inputBox = panels.input,
                    buttons = {}; // buttons.undo, buttons.link, etc. The actual DOM elements.
        
        
        Severity: Major
        Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 day to fix

          File Markdown.Converter.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var Markdown;
          
          if (typeof exports === "object" && typeof require === "function") // we're in a CommonJS (e.g. Node.js) module
              Markdown = exports;
          else
          Severity: Minor
          Found in app/assets/javascripts/pagedown/Markdown.Converter.js - About 7 hrs to fix

            Function UndoManager has 171 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function UndoManager(callback, panels) {
            
                    var undoObj = this;
                    var undoStack = []; // A stack of undo states
                    var stackPtr = 0; // The index of the current state
            Severity: Major
            Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 6 hrs to fix

              Function PreviewManager has 139 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function PreviewManager(converter, panels, previewRefreshCallback) {
              
                      var managerObj = this;
                      var timeout;
                      var elapsedTime;
              Severity: Major
              Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 5 hrs to fix

                Function tables has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  Markdown.Extra.prototype.tables = function(text) {
                    // Whitelist used as a post-processing step after calling convert.makeHtml()
                    // to keep only span-level tags inside tables per the PHP Markdown Extra spec.
                    var whitelist = /^(<\/?(b|del|em|i|s|sup|sub|strong|strike)>|<(br)\s?\/?>)$/i;
                    var that = this;
                Severity: Major
                Found in app/assets/javascripts/Markdown.Extra.js - About 4 hrs to fix

                  Function prompt has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ui.prompt = function (text, defaultInputText, callback) {
                  
                          // These variables need to be declared at this level since they are used
                          // in multiple functions.
                          var dialog;         // The dialog box.
                  Severity: Major
                  Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 4 hrs to fix

                    Function TextareaState has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function TextareaState(panels, isInitialState) {
                    
                            // Aliases
                            var stateObj = this;
                            var inputArea = panels.input;
                    Severity: Major
                    Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 3 hrs to fix

                      Function doBlockquote has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          commandProto.doBlockquote = function (chunk, postProcessing) {
                      
                              chunk.selection = chunk.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,
                                  function (totalMatch, newlinesBefore, text, newlinesAfter) {
                                      chunk.before += newlinesBefore;
                      Severity: Major
                      Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 3 hrs to fix

                        Function makeSpritedButtonRow has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                function makeSpritedButtonRow() {
                        
                                    var buttonBar = panels.buttonBar;
                        
                                    var normalYShift = "0px";
                        Severity: Major
                        Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 3 hrs to fix

                          Function doList has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              commandProto.doList = function (chunk, postProcessing, isNumberedList) {
                          
                                  // These are identical except at the very beginning and end.
                                  // Should probably use the regex extension function to make this clearer.
                                  var previousItemsRegex = /(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/;
                          Severity: Major
                          Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 2 hrs to fix

                            Function createDialog has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    var createDialog = function () {
                            
                                        // The main dialog box.
                                        dialog = doc.createElement("div");
                                        dialog.className = "wmd-prompt-dialog";
                            Severity: Major
                            Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 2 hrs to fix

                              Function doCode has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  commandProto.doCode = function (chunk, postProcessing) {
                              
                                      var hasTextBefore = /\S[ ]*$/.test(chunk.before);
                                      var hasTextAfter = /^[ ]*\S/.test(chunk.after);
                              
                              
                              Severity: Minor
                              Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 2 hrs to fix

                                Function doLinkOrImage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    commandProto.doLinkOrImage = function (chunk, postProcessing, isImage) {
                                
                                        chunk.trimWhitespace();
                                        chunk.findTags(/\s*!?\[/, /\][ ]?(?:\n[ ]*)?(\[.*?\])?/);
                                        var background;
                                Severity: Minor
                                Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                                  Function slide has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    , slide: function (type, next) {
                                        var $active = this.$element.find('.item.active')
                                          , $next = next || $active[type]()
                                          , isCycling = this.interval
                                          , direction = type == 'next' ? 'left' : 'right'
                                  Severity: Minor
                                  Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

                                    Function Editor has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        Markdown.Editor = function (markdownConverter, idPostfix, options) {
                                            
                                            options = options || {};
                                    
                                            if (typeof options.handler === "function") { //backwards compatible behavior
                                    Severity: Minor
                                    Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                                      Function skipLines has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          Chunks.prototype.skipLines = function (nLinesBefore, nLinesAfter, findExtraNewlines) {
                                      
                                              if (nLinesBefore === undefined) {
                                                  nLinesBefore = 1;
                                              }
                                      Severity: Minor
                                      Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                                        Function show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          , show: function () {
                                              var $tip
                                                , pos
                                                , actualWidth
                                                , actualHeight
                                        Severity: Minor
                                        Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language