Showing 10 of 10 total issues
Method parse
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
def parse(event)
obj = event.payload
repository = event.repo.name
status = title = link = ''
- 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 parse
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(event)
obj = event.payload
repository = event.repo.name
status = title = link = ''
Method stalking
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def stalking(&post)
return if @last_fetched_at && Time.now.utc < @last_fetched_at + INTERVAL
@last_fetched_at = Time.now.utc
@post = post
- 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 posts
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def posts(p)
header = ''
header = "(#{p[:repository]}) #{p[:status]}" unless p[:repository].eql? ''
header = "#{header} #{p[:title]}" unless p[:title].eql? ''
header = "#{header} - #{shorten(p[:link]).to_irc_color.blue}" unless p[:link].eql? ''
- 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 parse
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(type, data)
nick, obj = data
header = status = title = link = ''
body = []
notice_body = false
Method parse
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def parse(type, data)
nick, obj = data
header = status = title = link = ''
body = []
notice_body = 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 stalking
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stalking(&post)
return if @last_fetched_at && Time.now.utc < @last_fetched_at + INTERVAL
@last_fetched_at = Time.now.utc
@post = post
Method stalking
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def stalking(&post)
@post = post
client.received_events(@username).sort_by(&:id).reverse_each { |event|
if @last_event_id.nil?
time = Time.now - Stalkerr::Const::ROLLBACK_SEC
- 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 parse!
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse!(argv)
opts = {
host: Stalkerr::Const::DEFAULT_HOST,
port: Stalkerr::Const::DEFAULT_PORT,
log: nil,
Method guard
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def guard(params)
ch = params[:channel]
return if @threads[ch].is_a?(Thread) && @threads[ch].alive?
post @nick, JOIN, ch
- 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"