Showing 3 of 7 total issues
Class AppGenerator
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class AppGenerator < Rails::Generators::AppGenerator
@options = nil
# Default settings
class_option :database,
File app_generator.rb
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
module Cybele
class AppGenerator < Rails::Generators::AppGenerator
Method customize_gemfile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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]
- Read upRead up
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"