rubinius/rubinius

View on GitHub
build/scripts/daedalus.rb

Summary

Maintainability
F
3 days
Test Coverage

File daedalus.rb has 853 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'fileutils'
require 'digest/sha1'
require 'thread'
require 'dependency_grapher'

Severity: Major
Found in build/scripts/daedalus.rb - About 2 days to fix

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

        def objects
          # This partitions the list into .o's first and .a's last. This
          # is because gcc on some platforms require that static libraries
          # be linked last. This is because gcc builds a list of undefined
          # symbols, and then when it hits a .a, looks in the archive
    Severity: Minor
    Found in build/scripts/daedalus.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 out_of_date? has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def out_of_date?(ctx)
          unless File.exist?(@path)
            return true if @autogen_builder
            raise Errno::ENOENT, "Missing #{@path}"
          end
    Severity: Minor
    Found in build/scripts/daedalus.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 out_of_date? has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def out_of_date?(compiler)
          Dir.chdir @base do
            return true unless File.exist? name
            @sources.each do |s|
              return true unless File.exist? s.object_path
    Severity: Minor
    Found in build/scripts/daedalus.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 build has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def build(targets=[], jobs=nil)
          if !targets.empty?
            @programs.each do |x|
              if targets.include? x.path
                tasks = Tasks.new
    Severity: Minor
    Found in build/scripts/daedalus.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 perform_tasks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def perform_tasks(tasks)
          count = tasks.size
    
          puts "Running #{count} tasks using #{@max} parallel threads"
          start = Time.now
    Severity: Minor
    Found in build/scripts/daedalus.rb - About 1 hr to fix

      Method perform_tasks has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def perform_tasks(tasks)
            count = tasks.size
      
            puts "Running #{count} tasks using #{@max} parallel threads"
            start = Time.now
      Severity: Minor
      Found in build/scripts/daedalus.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(cc, cxx, ldshared, ldsharedxx, logger, blueprint)
      Severity: Minor
      Found in build/scripts/daedalus.rb - About 45 mins to fix

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

            def describe(ctx)
              if !File.exist?(object_path)
                puts "#{@path}: unbuilt"
              else
                if @data[:sha1] != sha1(ctx)
        Severity: Minor
        Found in build/scripts/daedalus.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 ll_compile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def ll_compile(ctx, source, object)
              ctx.log.show "LL", source
        
              flags = (ctx.cflags + ctx.cxxflags).join(" ").
                gsub(/-O.?/, "")
        Severity: Minor
        Found in build/scripts/daedalus.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 detect_cpus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def self.detect_cpus
              if RUBY_PLATFORM =~ /windows/
                return 1
              else
                if RUBY_PLATFORM =~ /bsd/
        Severity: Minor
        Found in build/scripts/daedalus.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

        Avoid too many return statements within this method.
        Open

              return false
        Severity: Major
        Found in build/scripts/daedalus.rb - About 30 mins to fix

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

              def initialize(cc, cxx, ldshared, ldsharedxx, logger, blueprint)
                @cc = cc
                @cxx = cxx
                @ldshared = ldshared
                @ldsharedxx = ldsharedxx
          Severity: Minor
          Found in build/scripts/daedalus.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 out_of_date? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def out_of_date?(ctx)
                return true  unless have_objects
                return false unless @builder
                return false if @data and @data[:sha1] == sha1
                return true
          Severity: Minor
          Found in build/scripts/daedalus.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

          There are no issues that match your filters.

          Category
          Status