library/desktop/src/clients/menu.rb
Method main
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
Open
def main
Yast.import "UI"
textdomain "base"
- 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 main
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def main
Yast.import "UI"
textdomain "base"
File menu.rb
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "shellwords"
module Yast
class MenuClient < Client
def main
Method OpenMenu
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def OpenMenu
# check if user is root (#246015)
output = Convert.to_map(
SCR.Execute(path(".target.bash_output"), "/usr/bin/id --user")
)
Method ShowNcursesHelp
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def ShowNcursesHelp
# NCurses (textmode) Control Center headline
headline = _("Controlling YaST ncurses with the Keyboard")
# NCurses Control Center help 1/
Method Launch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def Launch(modul)
function = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Call"], "")
argument = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Argument"], "")
Builtins.y2debug("Calling: %1 (%2)", function, argument)
Method Launch
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def Launch(modul)
function = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Call"], "")
argument = Ops.get_string(@Modules, [modul, "X-SuSE-YaST-Argument"], "")
Builtins.y2debug("Calling: %1 (%2)", function, argument)
- 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"