cornelius/inqlude

View on GitHub
lib/rpm_manifestizer.rb

Summary

Maintainability
C
1 day
Test Coverage

Method process_all_rpms has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  def process_all_rpms
    if !File.exist? @settings.cache_dir + "/qt_source.json"
      create_qt_source_cache
    end
    
Severity: Minor
Found in lib/rpm_manifestizer.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 create_manifest has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_manifest name, rpm_name
    qf = 'version:%{VERSION}\n'
    qf += 'summary:%{SUMMARY}\n'
    qf += 'homepage:%{URL}\n'
    qf += 'license:%{LICENSE}\n'
Severity: Major
Found in lib/rpm_manifestizer.rb - About 2 hrs to fix

    Method create_qt_source_cache has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

      def create_qt_source_cache
        puts "Creating cache of Qt library RPMs"
    
        sources = read_source_cache
    
    
    Severity: Minor
    Found in lib/rpm_manifestizer.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 process_all_rpms has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def process_all_rpms
        if !File.exist? @settings.cache_dir + "/qt_source.json"
          create_qt_source_cache
        end
        
    Severity: Minor
    Found in lib/rpm_manifestizer.rb - About 1 hr to fix

      Method create_manifest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def create_manifest name, rpm_name
          qf = 'version:%{VERSION}\n'
          qf += 'summary:%{SUMMARY}\n'
          qf += 'homepage:%{URL}\n'
          qf += 'license:%{LICENSE}\n'
      Severity: Minor
      Found in lib/rpm_manifestizer.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 create_qt_source_cache has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def create_qt_source_cache
          puts "Creating cache of Qt library RPMs"
      
          sources = read_source_cache
      
      
      Severity: Minor
      Found in lib/rpm_manifestizer.rb - About 1 hr to fix

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

          def cut_off_number_suffix name
            if @cut_off_exceptions.include? name
              return name
            end
        
        
        Severity: Minor
        Found in lib/rpm_manifestizer.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