Showing 49 of 49 total issues
Method api
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def api(path, query = {}, opts = {})
path.sub!(%r{\A/+}, "")
uri = api_base
uri.path += path
- 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 escape_http_urls
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def escape_http_urls(text)
original_text = text.encoding!("UTF-8").dup
if defined? ::Punycode
# TODO: Nameprep
- 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
Class Session
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Session < Net::IRC::Server::Session
include Util
class << self
def self.class_writer(*ids)
File session.rb
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fileutils'
require 'atig/util'
require "ostruct"
require "time"
require 'yaml'
Method resolve_http_redirect
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def resolve_http_redirect(uri, limit = 3)
return uri if limit.zero? or uri.nil?
log :debug, uri.inspect
req = @http.req :head, uri
@http.http(uri, 3, 2).request(req) do |res|
- 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 initialize
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def initialize(context, api, db)
@log = context.log
@api = api
@prev = nil
- 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 watch
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def watch(path, query={}, &f)
path.sub!(%r{\A/+}, "")
uri = api_base
uri.path += path
- 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 on_user
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def on_user(m)
super
@thread_group = ThreadGroup.new
@thread_group.add Thread.current
@ctcp_actions = {}
- 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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.start(opt={})
opt = DEFAULTS.dup.merge(opt)
Thread.new do
prev = Hash.new(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 on_user
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_user(m)
super
@thread_group = ThreadGroup.new
@thread_group.add Thread.current
@ctcp_actions = {}
Method latest
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def latest
unless git? then
[]
else
cs = commits
- 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 api
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def api(path, query = {}, opts = {})
path.sub!(%r{\A/+}, "")
uri = api_base
uri.path += path
Method action
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def action(target, mesg, command,args)
if args.empty?
yield "/me #{command} <ID>"
return
end
- 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 req
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def req(method, uri, header = {}, credentials = nil)
accepts = ["*/*"]
types = { "json" => "application/json", "txt" => "text/plain" }
ext = uri.path[/[^.]+\z/]
accepts.unshift types[ext] if types.key?(ext)
- 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 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse!(argv)
opts = {
port: 16668,
host: "localhost",
log: nil,
Method initialize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def initialize(context, gateway, db)
super
@log = context.log
@channel.notify "Client options: #{context.opts.marshal_dump.inspect}"
- 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 action
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def action(target, mesg, command, args)
if args.empty?
yield "/me #{command} <ID1> <ID2> ..."
return
end
- 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 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.start(opt={})
opt = DEFAULTS.dup.merge(opt)
Thread.new do
prev = Hash.new(0)
Method update
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update(users)
@db.execute do|db|
may_notify :join, users.select{|u|
not exists?(db,
"screen_name = ?",
Method escape_http_urls
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def escape_http_urls(text)
original_text = text.encoding!("UTF-8").dup
if defined? ::Punycode
# TODO: Nameprep