alain-andre/alain-andre-fr

View on GitHub

Showing 67 of 109 total issues

Avoid deeply nested control flow statements.
Open

            elsif t == '"'
              # Special case: single-character " token
              if prev_token_last_char =~ /\S/
                t = "”"
              else
Severity: Major
Found in plugins/rubypants.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if prev_token_last_char =~ /\S/
                    t = "’"
                  else
                    t = "‘"
                  end
    Severity: Major
    Found in plugins/rubypants.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (i.toLowerCase() == "data") {
                                  parObj.movie = attObj[i];
                              }
                              else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
                                  att += ' class="' + attObj[i] + '"';
      Severity: Major
      Found in source/javascripts/libs/swfobject-dynamic.js - About 45 mins to fix

        Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def initialize(config, page, all_posts, index_dir, pagination_dir, num_pages = nil)
        Severity: Minor
        Found in plugins/pagination.rb - About 45 mins to fix

          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def initialize(title, url, date, categories, body)
          Severity: Minor
          Found in .themes/octopress-lunr-theme/plugins/octopress_lunr_theme.rb - About 35 mins to fix

            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def initialize(title, url, date, categories, body)
            Severity: Minor
            Found in plugins/octopress_lunr_theme.rb - About 35 mins to fix

              Method initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def initialize(tag_name, markup, tokens)
                    @title = nil
                    @caption = nil
                    @filetype = nil
                    @highlight = true
              Severity: Minor
              Found in plugins/code_block.rb - About 25 mins 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

              Severity
              Category
              Status
              Source
              Language