Method ProposalSummary
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
def ProposalSummary
# output: $[ "output" : "HTML Proposal", "warning" : "HTML Warning" ];
output = ""
warning = ""
- 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
File SuSEFirewallProposal.rb
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yast"
module Yast
class SuSEFirewallProposalClass < Module
include Yast::Logger
Method ProposalSummary
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ProposalSummary
# output: $[ "output" : "HTML Proposal", "warning" : "HTML Warning" ];
output = ""
warning = ""
Class SuSEFirewallProposalClass
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class SuSEFirewallProposalClass < Module
include Yast::Logger
def main
textdomain "base"
Method ProposeFunctions
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ProposeFunctions
known_interfaces = SuSEFirewall.GetAllKnownInterfaces
dial_up_interfaces = []
non_dup_interfaces = []
Method ProposeFunctions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def ProposeFunctions
known_interfaces = SuSEFirewall.GetAllKnownInterfaces
dial_up_interfaces = []
non_dup_interfaces = []
- 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 UpdateProposal
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def UpdateProposal
last_known_interfaces = GetKnownInterfaces()
currently_known_interfaces = SuSEFirewall.GetListOfKnownInterfaces
had_dialup_interfaces = false
Method UpdateProposal
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def UpdateProposal
last_known_interfaces = GetKnownInterfaces()
currently_known_interfaces = SuSEFirewall.GetListOfKnownInterfaces
had_dialup_interfaces = false
- 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 IsServiceOrPortsOpen
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def IsServiceOrPortsOpen(service, fallback_ports)
fallback_ports = deep_copy(fallback_ports)
ret = false
Builtins.foreach(SuSEFirewall.GetKnownFirewallZones) do |zone|
- 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
Avoid deeply nested control flow statements. Open
is_vnc_enabled = true if set_vnc_enabled_to == true
Avoid deeply nested control flow statements. Open
if SuSEFirewall.HaveService(one_port, "TCP", zone) != true
set_vnc_enabled_to = false
raise Break
end