File proposal_store.rb
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Installation
# 1. Provides access to metadata of proposal parts (clients), as defined in the control file
# elements /productDefines/proposals/proposal:
Class ProposalStore
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class ProposalStore
include Yast::Logger
include Yast::I18n
# How many times to maximally (re)run the proposal while some proposal clients
Method make_proposals
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def make_proposals(force_reset: false, language_changed: false, callback: proc {})
clear_proposals
# At first run, all clients will be called
call_proposals = proposal_names
- Read upRead up
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 global_help
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def global_help
case @proposal_mode
when "initial"
if Yast::Mode.installation
# Help text for installation proposal
- Read upRead up
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 should_be_called_again?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def should_be_called_again?(client)
@proposals ||= {}
return false unless @proposals.fetch(client, {}).key?("trigger")
trigger = @proposals[client]["trigger"]
- Read upRead up
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_only_proposals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_only_proposals
return @read_only_proposals if @read_only_proposals
@read_only_proposals = { hard: [], soft: [] }
- Read upRead up
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 description_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def description_for(client)
@descriptions ||= {}
return @descriptions[client] if @descriptions.key?(client)
description = Yast::WFM.CallFunction(client, ["Description", {}])
- Read upRead up
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"