vasyl-purchel/alpaca

View on GitHub

Showing 7 of 12 total issues

Method load_extended_characters has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def load_extended_characters(file)
      until file.eof?
        i = file.gets.strip.split(/ /).first
        if i && i.empty?
          next
Severity: Minor
Found in lib/alpacabuildtool/log/font.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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def validate
      fail FileNotFound unless File.exist?(@file)
      fail MajorVersionNotInt unless @major.is_a?(Integer)
      fail MinorVersionNotInt unless @minor.is_a?(Integer)
      fail PatchVersionNotInt unless @patch.is_a?(Integer)
Severity: Minor
Found in lib/alpacabuildtool/versioning/version.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 each_solution has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def each_solution(pattern)
      Dir.glob(pattern).each do |file|
        next unless File.file?(file) && file.end_with?('.sln')
        solution = Solution.new(file)
        log.puts solution
Severity: Minor
Found in lib/alpacabuildtool/application.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 install has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def install(package,
                outputdir = nil,
                prerelease = false,
                exclude_version = false,
                source = nil)
Severity: Minor
Found in lib/alpacabuildtool/tools/nuget.rb - About 35 mins to fix

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

        def initialize(configuration)
          @configuration = configuration.dup
          @exe = @configuration['exe'] || ''
          @exe = find_executable @exe unless File.executable? @exe
          @exe = yield unless @exe || !block_given?
    Severity: Minor
    Found in lib/alpacabuildtool/tools/tool.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 create_package has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_package(config, version, options)
          config = generate_config(config, version)
          project = @solution.project(config['project'])
          changes, changelog = package_changes(config, project.dir)
          log.info "#{config['id']} unchanged..." unless changes
    Severity: Minor
    Found in lib/alpacabuildtool/managers/package_manager.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def initialize(name, content = nil, &block)
          @name = name
          return @content = content unless content.nil?
          return unless block_given?
          @arity = block.arity
    Severity: Minor
    Found in lib/alpacabuildtool/entities/xml_node.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