newtheatre/history-project

View on GitHub

Showing 32 of 117 total issues

Method people_iterator has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    def people_iterator(person)
      if person.data["shows"]
        # If had shows
        for record in person.data["shows"]
          # Loop through each show with involvement
Severity: Minor
Found in _plugins/people_by.rb - About 6 hrs 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_show has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_show(show)
      # Set year attributes
      show.data["year"] = get_show_year(show)
      show.data["year_page"] = get_show_year_page(show)

Severity: Minor
Found in _plugins/show.rb - About 4 hrs 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 28 (exceeds 5 allowed). Consider refactoring.
Open

    def generate(site)
      # Generate venue pages for venues without manually created pages.
      if not site.config["skip_venues"]
        @collection = site.collections["venues"]
        Jekyll.logger.info "Generating venues..."
Severity: Minor
Found in _plugins/venue.rb - About 4 hrs 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

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

function init() {
  var hadKeyboardEvent = false;
  var elWithFocusRing;

  var inputTypesWhitelist = {
Severity: Major
Found in js/focus-ring.js - About 3 hrs to fix

Method fill_people_reverse_index has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

def fill_people_reverse_index(item, people_list, index_name, site)

  # Create the RI for this case if first time
  unless site.data.key?(index_name)
    site.data[index_name] = Hash.new
Severity: Minor
Found in _plugins/person_list.rb - About 2 hrs 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_show has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def generate_show(show)
      # Set year attributes
      show.data["year"] = get_show_year(show)
      show.data["year_page"] = get_show_year_page(show)

Severity: Major
Found in _plugins/show.rb - About 2 hrs to fix

Method show_iterator has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def show_iterator(show)
      if show.data["season"]
        # Special case, UNCUT/Fringe being the same thing
        if show.data["season"] == "UNCUT"
          season_corrected = "Fringe"
Severity: Minor
Found in _plugins/shows_by.rb - About 2 hrs 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

File show.rb has 259 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Jekyll
  class ShowDataGenerator < Jekyll::Generator
    priority :high

    # From years.rb
Severity: Minor
Found in _plugins/show.rb - About 2 hrs to fix

Method generate_person has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_person(person)
      """Method called on all people"""
      # Validate things
      if not person.data.has_key?("title")
        Jekyll.logger.abort_with("Person record #{person.basename_without_ext} missing key 'title'")
Severity: Minor
Found in _plugins/people.rb - About 2 hrs 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 missing_majority has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def missing_majority(show)
      # We don't have crew_incomplete yet, so let's work it out.
      show_crew_count = show.data["crew"] ? show.data["crew"].length : 0
      amount_missing = 0 
      missing_fields = ''
Severity: Minor
Found in _plugins/show.rb - About 1 hr 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_person has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def generate_person(person)
      """Method called on all people"""
      # Validate things
      if not person.data.has_key?("title")
        Jekyll.logger.abort_with("Person record #{person.basename_without_ext} missing key 'title'")
Severity: Minor
Found in _plugins/people.rb - About 1 hr to fix

Method generate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def generate(site)
      # Generate venue pages for venues without manually created pages.
      if not site.config["skip_venues"]
        @collection = site.collections["venues"]
        Jekyll.logger.info "Generating venues..."
Severity: Minor
Found in _plugins/venue.rb - About 1 hr to fix

Method missing_majority has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def missing_majority(show)
      # We don't have crew_incomplete yet, so let's work it out.
      show_crew_count = show.data["crew"] ? show.data["crew"].length : 0
      amount_missing = 0 
      missing_fields = ''
Severity: Minor
Found in _plugins/show.rb - About 1 hr to fix

Method get_show_playwright has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def get_show_playwright(show)
      if show.data.key?("playwright") and not show.data["playwright"].nil?
        if show.data["playwright"] == "various"
          # Is various, special case
          ["various", nil, "Various Writers"]
Severity: Minor
Found in _plugins/show.rb - About 1 hr 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 roles has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def roles(set)
      roles = Set.new
      unless set.nil?
        for ri in set
          for role in ri['roles']
Severity: Minor
Found in _plugins/people_index.rb - About 1 hr 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 people_iterator has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def people_iterator(person)
      if person.data["shows"]
        # If had shows
        for record in person.data["shows"]
          # Loop through each show with involvement
Severity: Minor
Found in _plugins/people_by.rb - About 1 hr to fix

Method role_icons has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def role_icons
      role_icons = Hash.new
      for item in @roles
        if item.key?('role') and item.key?('icon')
          role_icons[item['role']] = item['icon']
Severity: Minor
Found in _plugins/roles.rb - About 1 hr 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 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def generate(site)
      Jekyll.logger.info "Generating people by..."

      @year_end = site.config['year_end']
      @role_map = site.data['role-map'].to_liquid
Severity: Minor
Found in _plugins/people_by.rb - About 1 hr to fix

Method fill_people_reverse_index has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def fill_people_reverse_index(item, people_list, index_name, site)

  # Create the RI for this case if first time
  unless site.data.key?(index_name)
    site.data[index_name] = Hash.new
Severity: Minor
Found in _plugins/person_list.rb - About 1 hr to fix

Method to_liquid has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def to_liquid
    if @isd
      h = {
        "key" => @imageID,
        # SM named sizes aren't really used
Severity: Minor
Found in _plugins/smugmug_image.rb - About 1 hr to fix
Severity
Category
Status
Source
Language