sue445/rubicure

View on GitHub

Showing 6 of 11 total issues

Class Girl has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Girl < Hash # rubocop:disable Metrics/ClassLength
    include Hashie::Extensions::MethodAccess

    using Rubicure::Concerns::Gengou

Severity: Minor
Found in lib/rubicure/girl.rb - About 3 hrs to fix

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

        def transform!(style = nil)
          if style
            raise "Unknown style: #{style}" unless has_transform_style?(style)
    
            @current_transform_style = style
    Severity: Minor
    Found in lib/rubicure/girl.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 find has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def find(series_name)
            raise UnknownSeriesError, "unknown series: #{series_name}" unless valid?(series_name)
    
            @cache ||= {}
            unless @cache[series_name]
    Severity: Minor
    Found in lib/rubicure/series.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 find has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def find(girl_name)
            raise "unknown girl: #{girl_name}" unless valid?(girl_name)
    
            @cache ||= {}
            unless @cache[girl_name]
    Severity: Minor
    Found in lib/rubicure/girl.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 all_stars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def all_stars(arg = Time.current)
          extra_girls = []
    
          # args is Time or Date
          date = to_date(arg)
    Severity: Minor
    Found in lib/rubicure/core.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 find has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def find(movie_name)
            raise UnknownMovieError, "unknown movie: #{movie_name}" unless valid?(movie_name)
    
            @cache ||= {}
            unless @cache[movie_name]
    Severity: Minor
    Found in lib/rubicure/movie.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