Showing 13 of 714 total issues
Method cmdLine
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmdLine(log, wss, configfile, commands, infoCommands)
log.info("Command line started.")
begin
while cmdIn = Readline::readline("\nbbs > ".colorize(:cyan))
case cmdIn.split()[0]
Method execCommandLoop
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def Command.execCommandLoop(log, wss)
puts "Commands are sent in anonymous functions wrapped in setTimeout(fn, 0) and the eval'd results are returned."
puts "Commands are also automatically wrapped in ws.send(), so omit any semicolons (;)."
puts "Enter the command to send (exit to return to the previous prompt)."
while cmdSend = Readline::readline("\ncmd ##{wss.getSelected()} > ".colorize(:magenta))
- 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 execCommand
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def Command.execCommand(log, wss, uglify, cmdIn)
selected = wss.getSelected()
wsList = wss.getWsList()
if cmdIn.length < 2
execCommandLoop(log, wss)
- 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 cmdLine
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def cmdLine(log, wss, configfile, commands, infoCommands)
log.info("Command line started.")
begin
while cmdIn = Readline::readline("\nbbs > ".colorize(:cyan))
case cmdIn.split()[0]
- 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 execCommand
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def Command.execCommand(log, wss, uglify, cmdIn)
selected = wss.getSelected()
wsList = wss.getWsList()
if cmdIn.length < 2
execCommandLoop(log, wss)
Method startEM
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def startEM(log, host, port, secure, priv_key, cert_chain, response_limit, outLoc)
log.info("Listening on host #{host}:#{port}")
EM.run {
EM::WebSocket.run({
:host => host,
Function createWindow
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createWindow() {
// You can change CommandOrControl+Alt+\ to the shortcut to manage the application.
globalShortcut.register('CommandOrControl+Alt+\\', function () {
let result = dialog.showMessageBox({
type: 'info',
Method startEM
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def startEM(log, host, port, secure, priv_key, cert_chain, response_limit, outLoc)
Method cmdLine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def cmdLine(log, wss, configfile, commands, infoCommands)
Method detectResult
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.detectResult(msg, ws, log, response_limit, outLoc)
Method loadConfig
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def Config.loadConfig
@@configfile = YAML.load_file("config.yml")
if @@configfile['secure']
if !File.exist?(@@configfile['priv_key'])
abort("Fatal error: Private key (#{@@configfile['priv_key']}) does not exist but is configured in config.yml.")
- 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 too many return
statements within this method. Open
return true
Method infoCommand
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def Command.infoCommand(log, info_commands, selected, wsList)
info_commands.each {|_key, cmd|
begin
if selected != -1
Bbs::WebSocket.sendCommand(cmd, wsList[selected])
- 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"