mattbrictson/nextgen

View on GitHub

Showing 7 of 29 total issues

Class RailsOptions has 38 methods (exceeds 20 allowed). Consider refactoring.
Open

  class RailsOptions
    extend Forwardable

    TEST_FRAMEWORKS = %i[minitest rspec].freeze

Severity: Minor
Found in lib/nextgen/rails_options.rb - About 5 hrs to fix

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

        def to_args # rubocop:disable Metrics/PerceivedComplexity
          [].tap do |args|
            args.push(*version.args)
            args << "--api" if api?
            args << "--skip-active-record" if skip_active_record?
    Severity: Minor
    Found in lib/nextgen/rails_options.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 handle_help_switches has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def handle_help_switches(given_args)
          yield(given_args.dup)
        rescue Thor::UnknownArgumentError => e
          retry_with_args = []
    
    
    Severity: Minor
    Found in lib/nextgen/thor_extensions.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 start has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def start(launcher)
        return unless defined?(Rails) && defined?(Launchy)
        return unless Rails.env.development?
    
        binding = launcher.options[:binds].grep(/^tcp|ssl/).first
    Severity: Minor
    Found in examples/all/lib/puma/plugin/open.rb - About 55 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 start has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def start(launcher)
        return unless defined?(Rails) && defined?(Launchy)
        return unless Rails.env.development?
    
        binding = launcher.options[:binds].grep(/^tcp|ssl/).first
    Severity: Minor
    Found in template/lib/puma/plugin/open.rb - About 55 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 apply_as_git_commit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def apply_as_git_commit(path, message: nil)
          say message, :cyan if message
          @commit_messages = []
          initially_clean = git_working? && git_status == :clean
          say_status :apply, File.basename(path)
    Severity: Minor
    Found in lib/nextgen/actions/git.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 git_status has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def git_status
          return :error unless Dir.exist?(".git")
    
          output, status = Open3.capture2e("git status --porcelain")
          return :error unless status.success?
    Severity: Minor
    Found in lib/nextgen/actions/git.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