Blahah/bindeps

View on GitHub

Showing 5 of 5 total issues

Method unpack has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def unpack destdir = ''
      destdir = File.expand_path destdir unless destdir.empty?
      archive = File.basename(@url)
      if @unpack
        Unpacker.archive? archive
Severity: Minor
Found in lib/bindeps.rb - About 3 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 missing has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def self.missing dependencies
    if dependencies.is_a? String
      dependencies = YAML.load_file dependencies
    end
    missing = []
Severity: Minor
Found in lib/bindeps.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 require has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def self.require(dependencies, destdir = '')
    destdir = File.expand_path destdir unless destdir.empty?
    if dependencies.is_a? String
      dependencies = YAML.load_file dependencies
    end
Severity: Minor
Found in lib/bindeps.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(name, binaries, versionconfig, urlconfig,
                   unpack, libraries=[])
Severity: Minor
Found in lib/bindeps.rb - About 45 mins to fix

    Method installed? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def installed? bin
          path = which(bin)
          if path.length > 0
            ret = `#{@version_cmd} 2>&1`.split("\n").map{ |l| l.strip }.join('|')
            if ret && (/#{@version}/ =~ ret)
    Severity: Minor
    Found in lib/bindeps.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

    Severity
    Category
    Status
    Source
    Language