codeforamerica/oakland_answers

View on GitHub

Showing 44 of 97 total issues

Function balanceTags has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function balanceTags(html) {

        if (html == "")
            return "";

Severity: Minor
Found in app/assets/javascripts/pagedown/Markdown.Sanitizer.js - About 1 hr to fix

    Function makeTables has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function makeTables(text) {
          var blockdata;
          while ((blockdata = findNextBlock(text)) !== null) {
            var block = blockdata.block,
                bounds = blockdata.bounds,
    Severity: Minor
    Found in app/assets/javascripts/Markdown.Extra.js - About 1 hr to fix

      Function addLinkDef has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          commandProto.addLinkDef = function (chunk, linkDef) {
      
              var refNumber = 0; // The current reference number
              var defsToAdd = {}; //
              // Start with a clean slate by removing all previous link definitions.
      Severity: Minor
      Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

        Function setupButton has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function setupButton(button, isEnabled) {
        
                    var normalYShift = "0px";
                    var disabledYShift = "-20px";
                    var highlightYShift = "-40px";
        Severity: Minor
        Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

          Function writeAnchorTag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function writeAnchorTag(wholeMatch, m1, m2, m3, m4, m5, m6, m7) {
                      if (m7 == undefined) m7 = "";
                      var whole_match = m1;
                      var link_text = m2.replace(/:\/\//g, "~P"); // to prevent auto-linking withing the link. will be converted back after the auto-linker runs
                      var link_id = m3.toLowerCase();
          Severity: Minor
          Found in app/assets/javascripts/pagedown/Markdown.Converter.js - About 1 hr to fix

            Function doHeading has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                commandProto.doHeading = function (chunk, postProcessing) {
            
                    // Remove leading/trailing whitespace and reduce internal spaces to single spaces.
                    chunk.selection = chunk.selection.replace(/\s+/g, " ");
                    chunk.selection = chunk.selection.replace(/(^\s+|\s+$)/g, "");
            Severity: Minor
            Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

              Function _FormParagraphs has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function _FormParagraphs(text, doNotUnhash) {
                          //
                          //  Params:
                          //    $text - string to process with html <p> tags
                          //
              Severity: Minor
              Found in app/assets/javascripts/pagedown/Markdown.Converter.js - About 1 hr to fix

                Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  , applyPlacement: function(offset, placement){
                      var $tip = this.tip()
                        , width = $tip[0].offsetWidth
                        , height = $tip[0].offsetHeight
                        , actualWidth
                Severity: Minor
                Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

                  Function init has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Markdown.Extra.init = function(converter, options) {
                      // Each call to init creates a new instance of Markdown.Extra so it's
                      // safe to have multiple converters on a single page
                      var extra = new Markdown.Extra();
                  
                  
                  Severity: Minor
                  Found in app/assets/javascripts/Markdown.Extra.js - About 1 hr to fix

                    Function setInputAreaSelectionStartEnd has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            this.setInputAreaSelectionStartEnd = function () {
                    
                                if (!panels.ieCachedRange && (inputArea.selectionStart || inputArea.selectionStart === 0)) {
                    
                                    stateObj.start = inputArea.selectionStart;
                    Severity: Minor
                    Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                      Function Autocomplete has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.Indextank.Autocomplete = function(el, options){
                              // To avoid scope issues, use 'base' instead of 'this'
                              // to reference this class from internal events and functions.
                              var base = this;
                              
                      Severity: Minor
                      Found in app/assets/javascripts/indextank/jquery.indextank.autocomplete.js - About 1 hr to fix

                        Function doAutoindent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            commandProto.doAutoindent = function (chunk, postProcessing) {
                        
                                var commandMgr = this,
                                    fakeSelection = false;
                        
                        
                        Severity: Minor
                        Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                          Function findTags has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              Chunks.prototype.findTags = function (startRegex, endRegex) {
                          
                                  var chunkObj = this;
                                  var regex;
                          
                          
                          Severity: Minor
                          Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                            Function writeImageTag has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function writeImageTag(wholeMatch, m1, m2, m3, m4, m5, m6, m7) {
                                        var whole_match = m1;
                                        var alt_text = m2;
                                        var link_id = m3.toLowerCase();
                                        var url = m4;
                            Severity: Minor
                            Found in app/assets/javascripts/pagedown/Markdown.Converter.js - About 1 hr to fix

                              Function handleCtrlYZ has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      var handleCtrlYZ = function (event) {
                              
                                          var handled = false;
                              
                                          if (event.ctrlKey || event.metaKey) {
                              Severity: Minor
                              Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                                Function getPageSize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    position.getPageSize = function () {
                                
                                        var scrollWidth, scrollHeight;
                                        var innerWidth, innerHeight;
                                
                                
                                Severity: Minor
                                Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                                  Function fencedCodeBlocks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    Markdown.Extra.prototype.fencedCodeBlocks = function(text) {
                                      function encodeCode(code) {
                                        code = code.replace(/&/g, "&amp;");
                                        code = code.replace(/</g, "&lt;");
                                        code = code.replace(/>/g, "&gt;");
                                  Severity: Minor
                                  Found in app/assets/javascripts/Markdown.Extra.js - About 1 hr to fix

                                    Function doClick has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            function doClick(button) {
                                    
                                                inputBox.focus();
                                    
                                                if (button.textOp) {
                                    Severity: Minor
                                    Found in app/assets/javascripts/pagedown/Markdown.Editor.js - About 1 hr to fix

                                      Function keydown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        , keydown: function (e) {
                                            var $this
                                              , $items
                                              , $active
                                              , $parent
                                      Severity: Minor
                                      Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

                                        Function _ProcessListItems has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                function _ProcessListItems(list_str, list_type) {
                                                    //
                                                    //  Process the contents of a single ordered or unordered list, splitting it
                                                    //  into individual list items.
                                                    //
                                        Severity: Minor
                                        Found in app/assets/javascripts/pagedown/Markdown.Converter.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language