kebab-project/cybele

View on GitHub

Showing 3 of 7 total issues

Class AppGenerator has 41 methods (exceeds 20 allowed). Consider refactoring.
Open

  class AppGenerator < Rails::Generators::AppGenerator
    @options = nil

    # Default settings
    class_option :database,
Severity: Minor
Found in lib/cybele/generators/app_generator.rb - About 5 hrs to fix

    File app_generator.rb has 285 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'rails/generators'
    require 'rails/generators/rails/app/app_generator'
    
    module Cybele
      class AppGenerator < Rails::Generators::AppGenerator
    Severity: Minor
    Found in lib/cybele/generators/app_generator.rb - About 2 hrs to fix

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

          def customize_gemfile
            say 'Customize gem file', :green
            build :add_gems
            build :add_simple_form_gem unless @options[:skip_simple_form]
            build :add_show_for_gem unless @options[:skip_show_for]
      Severity: Minor
      Found in lib/cybele/generators/app_generator.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

      Severity
      Category
      Status
      Source
      Language