sverrirs/jekyll-paginate-v2

View on GitHub

Showing 27 of 201 total issues

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

      def initialize(site, base, autopage_config, pagination_config, layout_name, collection, collection_name)
Severity: Major
Found in lib/jekyll-paginate-v2/autopages/pages/collectionAutoPage.rb - About 50 mins to fix

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

        def self.autopage_create(autopage_config, pagination_config, posts_to_use, configkey_name, indexkey_name, createpage_lambda )
    Severity: Minor
    Found in lib/jekyll-paginate-v2/autopages/autoPages.rb - About 45 mins to fix

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

            def self.read_config_value_and_filter_posts(config, config_key, posts, source_posts, should_union = false)
      Severity: Minor
      Found in lib/jekyll-paginate-v2/generator/paginationIndexer.rb - About 35 mins to fix

        Avoid too many return statements within this method.
        Open

                return posts if config[config_key].nil?
        Severity: Major
        Found in lib/jekyll-paginate-v2/generator/paginationIndexer.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return a <=> b
          Severity: Major
          Found in lib/jekyll-paginate-v2/generator/utils.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return posts
            Severity: Major
            Found in lib/jekyll-paginate-v2/generator/paginationIndexer.rb - About 30 mins to fix

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

                    def self.sort_values(a, b)
                      if a.nil? && !b.nil?
                        return -1
                      elsif !a.nil? && b.nil?
                        return 1
              Severity: Minor
              Found in lib/jekyll-paginate-v2/generator/utils.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