rubymem/bundler-leak

View on GitHub

Showing 4 of 4 total issues

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

      def self.update!(options={})
        raise "Invalid option(s)" unless (options.keys - [:quiet]).empty?
        if File.directory?(USER_PATH)
          if File.directory?(File.join(USER_PATH, ".git"))
            Dir.chdir(USER_PATH) do
Severity: Minor
Found in lib/bundler/plumber/database.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 update has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def update
        say("Updating ruby-mem-advisory-db ...") unless options.quiet?

        case Database.update!(quiet: options.quiet?)
        when true
Severity: Minor
Found in lib/bundler/plumber/cli.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 scan_specs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def scan_specs(options={})
        return enum_for(__method__, options) unless block_given?

        ignore = Set[]
        ignore += options[:ignore] if options[:ignore]
Severity: Minor
Found in lib/bundler/plumber/scanner.rb - About 35 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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def check
        update if options[:update]

        scanner    = Scanner.new
        leaky = false
Severity: Minor
Found in lib/bundler/plumber/cli.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