yast/yast-yast2

View on GitHub
library/packages/src/lib/y2packager/release_notes_fetchers/url.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Class Url has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Url < Base
      class << self
        # Enable downloading release notes
        #
        # This method is intended to be used during testing.
Severity: Minor
Found in library/packages/src/lib/y2packager/release_notes_fetchers/url.rb - About 2 hrs to fix

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

          def curl_proxy_args
            # Import the module when it is needed to avoid building projects (bsc#1079045)
            Yast.import "Proxy"
    
            return @curl_proxy_args if @curl_proxy_args
    Severity: Minor
    Found in library/packages/src/lib/y2packager/release_notes_fetchers/url.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 download_release_notes_index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

          def download_release_notes_index(url_base)
            url_index = url_base + "/directory.yast"
            log.info("Index with available files: #{url_index}")
            tmpfile = Tempfile.new("directory.yast-")
    
    
    Severity: Minor
    Found in library/packages/src/lib/y2packager/release_notes_fetchers/url.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 release_notes_content_for_lang_and_format has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def release_notes_content_for_lang_and_format(lang, format)
            # If there is an index and the language is not indexed
            return nil unless release_notes_index.empty? || indexed_release_notes_for?(lang, format)
    
            # Where we want to store the downloaded release notes
    Severity: Minor
    Found in library/packages/src/lib/y2packager/release_notes_fetchers/url.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