newtheatre/history-project

View on GitHub

Showing 32 of 117 total issues

Function make_template has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def make_template(title, period, sort, season, playwright, date_start, date_end, content):
Severity: Major
Found in _bin/stub_maker.py - About 1 hr to fix

Method generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def generate(site)
      if not site.config["skip_seasons"]
        @collection = site.collections["seasons"]
        Jekyll.logger.info "Generating seasons..."

Severity: Minor
Found in _plugins/season.rb - About 45 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

Method generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def generate(site)
      if not site.config["skip_virtual_people"]
        @collection = site.collections["people"]
        Jekyll.logger.info "Generating virtual people..."

Severity: Minor
Found in _plugins/people.rb - About 45 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

Method generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def generate(site)
      if not site.config["skip_years"]
        @collection = site.collections["years"]
        Jekyll.logger.info "Generating years..."

Severity: Minor
Found in _plugins/year.rb - About 45 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

Method cache_fetch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def cache_fetch(id)
    if File.exist?(cache_filename(id))
      cache_file = File.open(cache_filename(id), "r")
      cache_data = JSON.load(cache_file)
      cache_file.close
Severity: Minor
Found in _plugins/smugmug.rb - About 35 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

Method get_show_asset_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def get_show_asset_type(show, key, image_only=true)
      show.data["assets"].select do |i|
        # Skip non-images if image_only
        if image_only and not i.key?("image") then next end

Severity: Minor
Found in _plugins/show.rb - About 35 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

Method get_show_display_image has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def get_show_display_image(show)
      # Assets required
      return nil unless show.data.key?("assets")

      # Find assets that fit the criteria for being a display image
Severity: Minor
Found in _plugins/show.rb - About 35 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

Avoid too many return statements within this method.
Open

        return programmes[0]
Severity: Major
Found in _plugins/show.rb - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return nil
Severity: Major
Found in _plugins/show.rb - About 30 mins to fix

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

    def role_map
      role_map = Hash.new
      for item in @roles
        role_map[item['role']] = item['role']

Severity: Minor
Found in _plugins/roles.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

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

def parse_person_list(pl, people_by_filename)
  """Add additional data to a person_list"""
  for pli in pl
    if pli.key?("name")
      filename = make_hp_path(pli["name"])
Severity: Minor
Found in _plugins/person_list.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

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

    def generate_asset(show, asset)
      """Method called for each asset in the asset attribute"""
      # Assign the show as an attr of the asset
      asset["show"] = show

Severity: Minor
Found in _plugins/assets.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