cornelius/inqlude

View on GitHub

Showing 29 of 29 total issues

Method parse_readme has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

  def parse_readme path, options = {}
    @errors = [] if !@errors

    name = extract_name( path )
    framework = @frameworks[name] || {}
Severity: Minor
Found in lib/kde_frameworks_creator.rb - About 5 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

Class View has 40 methods (exceeds 20 allowed). Consider refactoring.
Open

class View

  attr_accessor :enable_disqus,:enable_search,:manifest,:library,:group_name,:templates
  attr_reader :root

Severity: Minor
Found in lib/view.rb - About 5 hrs to fix

    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 parse_readme has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def parse_readme path, options = {}
          @errors = [] if !@errors
      
          name = extract_name( path )
          framework = @frameworks[name] || {}
      Severity: Major
      Found in lib/kde_frameworks_creator.rb - About 2 hrs to fix

        File cli.rb has 262 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class Cli < Thor
        
          default_task :global
        
          class_option :version, :type => :boolean, :desc => "Show version"
        Severity: Minor
        Found in lib/cli.rb - About 2 hrs to fix

          File view.rb has 261 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class View
          
            attr_accessor :enable_disqus,:enable_search,:manifest,:library,:group_name,:templates
            attr_reader :root
          
          
          Severity: Minor
          Found in lib/view.rb - About 2 hrs to fix

            Method verify has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              def verify filename=nil
                process_global_options options
            
                v = Verifier.new @@settings
            
            
            Severity: Minor
            Found in lib/cli.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 read_topic_file has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            def read_topic_file(file)
              topics = {}
              CSV.foreach(file) do |row|
                row.each do |col|
                  lib = nil
            Severity: Minor
            Found in topics/list_topics.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 create has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              def create name, version=nil, release_date=nil
                @@settings.manifest_path = "."
                creator = Creator.new @@settings, name
                if creator.is_new?
                  if !version && release_date || version && !release_date
            Severity: Minor
            Found in lib/cli.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 verify has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

              def verify manifest
                @result = Result.new
            
                if !manifest.filename
                  @result.errors.push "Unable to determine filename"
            Severity: Minor
            Found in lib/verifier.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 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 installed has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              def installed handler
                packages = Hash.new
            
                `rpmqpack`.each_line do |package|
                  packages[package.chomp] = true
            Severity: Minor
            Found in lib/distros/suse.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 get_package_name has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              def get_package_name manifest
                package_section = manifest.packages.openSUSE
                if !package_section
                  STDERR.puts "No packages section in metadata"
                else
            Severity: Minor
            Found in lib/distros/suse.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 verify has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def verify filename=nil
                process_global_options options
            
                v = Verifier.new @@settings
            
            
            Severity: Minor
            Found in lib/cli.rb - About 1 hr to fix

              Method create has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def create output_dir
                  assert_dir output_dir
              
                  system "cp #{view_dir}/favicon.ico #{output_dir}"
              
              
              Severity: Minor
              Found in lib/view.rb - About 1 hr to fix

                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 verify has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def verify manifest
                      @result = Result.new
                  
                      if !manifest.filename
                        @result.errors.push "Unable to determine filename"
                  Severity: Minor
                  Found in lib/verifier.rb - About 1 hr to fix

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

                      def parse_checkout dir_name, options = {}
                        @warnings = []
                        @errors = []
                        Dir.entries( dir_name ).each do |entry|
                          next if entry =~ /^\./
                    Severity: Minor
                    Found in lib/kde_frameworks_creator.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_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

                    Severity
                    Category
                    Status
                    Source
                    Language