XanderStrike/caketop-theater

View on GitHub

Showing 24 of 24 total issues

File markdown.js has 999 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)
Severity: Major
Found in app/assets/javascripts/markdown.js - About 2 days to fix

    Function lists has 156 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        lists: (function( ) {
          // Use a closure to hide a few variables.
          var any_list = "[*+-]|\\d+\\.",
              bullet_list = /[*+-]/,
              number_list = /\d+\./,
    Severity: Major
    Found in app/assets/javascripts/markdown.js - About 6 hrs to fix

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

          case "link_ref":
            jsonml[ 0 ] = "a";
      
            // grab this ref and clean up the attribute node
            var ref = references[ attrs.ref ];
      Severity: Major
      Found in app/assets/javascripts/markdown.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/markdown.js on lines 1535..1558

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

      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

          case "img_ref":
            jsonml[ 0 ] = "img";
      
            // grab this ref and clean up the attribute node
            var ref = references[ attrs.ref ];
      Severity: Major
      Found in app/assets/javascripts/markdown.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/markdown.js on lines 1511..1534

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

      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

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

      function convert_tree_to_html( tree, references, options ) {
        var i;
        options = options || {};
      
        // shallow clone
      Severity: Major
      Found in app/assets/javascripts/markdown.js - About 4 hrs to fix

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

                if ( m[2] && m[2][0] == '<' && m[2][m[2].length-1] == '>' )
                  m[2] = m[2].substring( 1, m[2].length - 1 );
        Severity: Major
        Found in app/assets/javascripts/markdown.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/markdown.js on lines 820..821

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

        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

                if ( m[2] && m[2][0] == '<' && m[2][m[2].length-1] == '>' )
                  m[2] = m[2].substring( 1, m[2].length - 1 );
        Severity: Major
        Found in app/assets/javascripts/markdown.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/markdown.js on lines 715..716

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

        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

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

          function keyHandler(handleObj) {
            if (typeof handleObj.data === "string") {
              handleObj.data = {
                keys: handleObj.data
              };
        Severity: Minor
        Found in app/assets/javascripts/jquery_hotkeys.js - About 2 hrs to fix

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

              "[": function link( text ) {
          
                var orig = String(text);
                // Inline content is possible inside `link text`
                var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), ']' );
          Severity: Minor
          Found in app/assets/javascripts/markdown.js - About 2 hrs to fix

            Function InstantHotkeys has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function InstantHotkeys() {
              var bindings = [];
            
              function sc(element, index, array) {
                return element.startsWith('hk-');
            Severity: Minor
            Found in app/assets/javascripts/instant-hotkeys.js - About 1 hr to fix

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

              function last() {
                  console.log($('.active').html())
                  $('.active').parent().prev().find('a').click();
              }
              Severity: Major
              Found in app/assets/javascripts/music.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/music.js on lines 15..18

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

              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

              function next() {
                  console.log($('.active').html())
                  $('.active').parent().next().find('a').click();
              }
              Severity: Major
              Found in app/assets/javascripts/music.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/music.js on lines 20..23

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

              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

              Function handler has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  handleObj.handler = function(event) {
                    //      Don't fire in text-accepting inputs that we didn't directly bind to
                    if (this !== event.target &&
                      (jQuery.hotkeys.options.filterInputAcceptingElements &&
                        jQuery.hotkeys.textInputTypes.test(event.target.nodeName) ||
              Severity: Minor
              Found in app/assets/javascripts/jquery_hotkeys.js - About 1 hr to fix

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

                      if ( m[0].length < block.length )
                        next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );
                Severity: Major
                Found in app/assets/javascripts/markdown.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/markdown.js on lines 327..328

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

                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

                      if ( m[0].length < block.length )
                        next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );
                Severity: Major
                Found in app/assets/javascripts/markdown.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/markdown.js on lines 313..314

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

                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

                Method retag has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def retag
                    encode = Encode.find(params[:id])
                    info = Tmdb::Movie.detail(params[:movie_id])
                
                    old_movie = Movie.find_by_id(encode.movie_id)
                Severity: Minor
                Found in app/controllers/encodes_controller.rb - About 1 hr to fix

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

                  function strong_em( tag, md ) {
                  
                    var state_slot = tag + "_state",
                        other_slot = tag == "strong" ? "em_state" : "strong_state";
                  
                  Severity: Minor
                  Found in app/assets/javascripts/markdown.js - About 1 hr to fix

                    Function block_meta has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Markdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {
                      // check if the last line of the block is an meta hash
                      var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ );
                      if ( !m ) return undefined;
                    
                    Severity: Minor
                    Found in app/assets/javascripts/markdown.js - About 1 hr to fix

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

                      function split_meta_hash( meta_string ) {
                        var meta = meta_string.split( "" ),
                            parts = [ "" ],
                            in_quotes = false;
                      
                      Severity: Minor
                      Found in app/assets/javascripts/markdown.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                              if (this !== event.target &&
                                (jQuery.hotkeys.options.filterInputAcceptingElements &&
                                  jQuery.hotkeys.textInputTypes.test(event.target.nodeName) ||
                                  (jQuery.hotkeys.options.filterContentEditable && jQuery(event.target).attr('contenteditable')) ||
                                  (jQuery.hotkeys.options.filterTextInputs &&
                        Severity: Major
                        Found in app/assets/javascripts/jquery_hotkeys.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language