Showing 37 of 64 total issues
File notifier.js
has 730 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Airbrake JavaScript Notifier Bundle
(function(window, document, undefined) {
// Domain Public by Eric Wendelin http://eriwen.com/ (2008)
// Luke Smith http://lucassmith.name/ (2008)
// Loic Dachary <loic@dachary.org> (2008)
File data_migration.rb
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'mongo'
include Mongo
class ActiveRecord::Base
Class App
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class App < ActiveRecord::Base
include Comparable
serialize :email_at_notices, Array
Class Worker
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Worker
# mapping should be a hash {:key_to => :key_from}
# value of this hash can be an object and respond to :call, which returns value for new key
USER_FIELDS_MAPPING = {
:remote_id => lambda{|v| v["_id"].to_s},
Class Notice
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Notice < ActiveRecord::Base
serialize :server_environment, Hash
serialize :request, Hash
serialize :notifier, Hash
Function _show
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
_show: function(title, msg, value, type, callback) {
$.alerts._hide();
$.alerts._overlay('show');
Method rekey
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def self.rekey(node)
case node
when Hash
if node.has_key?('var') && node.has_key?('key')
{normalize_key(node['key']) => rekey(node['var'])}
- 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 Problem
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Problem < ActiveRecord::Base
serialize :messages, Hash
serialize :user_agents, Hash
serialize :hosts, Hash
Function generateDataJSON
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateDataJSON: (function () {
/*
* Generate variables array for inputObj object.
*
* e.g.
Function handleRemote
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleRemote: function(element) {
var method, url, data, button,
crossDomain = element.data('cross-domain') || null,
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
options;
Function notify
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
notify: (function () {
/*
* Emit GET request via <iframe> element.
* Data is transmited as a part of query string.
*/
Method create_issue
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_issue(problem, reported_by = nil)
options = {
:username => username,
:password => password,
:site => base_url,
Function generateBacktrace
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateBacktrace: function (error) {
var backtrace = [],
file,
i,
matches,
Function generatePublicAPI
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
generatePublicAPI: (function () {
function _generateSetter (variable, namespace, configObj) {
return function (value) {
configObj[namespace][variable] = value;
};
Method default_values
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def default_values
if self.new_record?
self.user_agents ||= Hash.new
self.messages ||= Hash.new
self.hosts ||= Hash.new
- 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
Function stringifyArguments
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
stringifyArguments: function(args) {
var result = [];
var slice = Array.prototype.slice;
for (var i = 0; i < args.length; ++i) {
var arg = args[i];
Function findFunctionName
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
findFunctionName: function(source, lineNo) {
// FIXME findFunctionName fails for compressed source
// (more than one function on the same line)
// function {name}({args}) m[1]=name m[2]=args
var reFunctionDeclaration = /function\s+([^(]*?)\s*\(([^)]*)\)/;
Function mode
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
mode: function(e) {
if (e['arguments'] && e.stack) {
return 'chrome';
} else if (e.stack && e.sourceURL) {
return 'safari';
Method copy_attributes_from
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def copy_attributes_from(app_id)
if copy_app = App.find(app_id)
# Copy fields
(copy_app.attribute_names - %w(id name created_at updated_at)).each do |k|
self.send("#{k}=", copy_app.send(k))
- 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 tracker
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def tracker
return @tracker if @tracker
# Create an issue on GitHub using user's github token
if tracker_name == 'user_github'
- 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"