Showing 15 of 15 total issues
Class TrelloMessage
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class TrelloMessage
attr_reader :notfound
def initialize(action)
File trellolistener.rb
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "cgi"
module Cinch
module Plugins
Method fetch_rss
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def fetch_rss
@bot.debug 'Fetching rss'
@feeds ||= {}
@bot.config.options['cogconf']['rss']['channels'].each do |chan|
prefix = chan['prefix']
- 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 updateCard
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def updateCard
if @data['old']
if @data['listAfter']
updateCard_moved
elsif @data['old']['desc']
- 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 start
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
# prepare config
config = {}
begin
Method check_redmine
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def check_redmine
@issues ||= Array.new
api_key = @bot.config.options['cogconf']['redmine']['api_key']
redmine_url = "%s/issues.json?project_id=%s&limit=20" % [
@bot.config.options['cogconf']['redmine']['url'],
- 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 check_redmine
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_redmine
@issues ||= Array.new
api_key = @bot.config.options['cogconf']['redmine']['api_key']
redmine_url = "%s/issues.json?project_id=%s&limit=20" % [
@bot.config.options['cogconf']['redmine']['url'],
Method fetch_rss
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch_rss
@bot.debug 'Fetching rss'
@feeds ||= {}
@bot.config.options['cogconf']['rss']['channels'].each do |chan|
prefix = chan['prefix']
Method load_plugin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load_plugin(m, mapping)
authorized m do
plugin = mapping.downcase.camelize
file_name = "#{ROOT_DIR}/plugins/#{mapping.downcase}.rb"
- 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 query
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def query(query)
url = "https://rubygems.org/api/v1/search.json?query=#{CGI.escape(query)}"
back = "Requesting ... \n"
begin
file = open(url)
- 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 exec
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def exec(command,args)
commands = {
'psaux' => 'ps -aux',
'df' => 'df -h',
'last' => 'last',
- 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 files
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def files(c)
back = ""
back += '[= ' + short(c['modified']).join(' ') + ' ] ' unless c['modified'].empty?
back += '[- ' + short(c['removed']).join(' ') + ' ] ' unless c['removed'].empty?
back += '[+ ' + short(c['added']).join(' ') + ' ] ' unless c['added'].empty?
- 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 updateLabel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def updateLabel
if @data['old']
if @data['old']['name']
"changed label name \"%s\" to \"%s\"" % [
format(:orange, @data['old']['name']),
- 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 listen
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def listen(m, json)
hash = Yajl::Parser.parse(URI.unescape(json))
# bot.loggers.debug(hash.inspect)
if @bot.config.options['cogconf']['trello']
msg = TrelloMessage.new(hash['action'])
- 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 exec
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def exec(query,nick)
back ''
query.strip! rescue ''
nick.strip! rescue ''
if query.blank?
- 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"