Showing 93 of 184 total issues
Method build_parameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.build_parameters(parameter_names = [], modify_parameters = {})
file_name = ''
parameter_names.each do |param|
- 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 record_file_move
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def record_file_move(create_result_params)
Net::HTTP.start(@host, @port) do |http|
auth_token = request_login(http)
- 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 bird_tour_annotation_counts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def bird_tour_annotation_counts(steps)
# open file
filename = File.join(EXPERIMENTS_ASSETS_DIRECTORY, ANNOTATION_RESPONSE_COUNTS)
file_contents = File.open(filename, 'r') { |file| file.read }
- 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 function. Open
if (proto && typeof proto.toString == 'function') return proto.toString;
Avoid too many return
statements within this function. Open
return stringFromAny(params[num], format); //convert the input replacement to a proper string
Avoid too many return
statements within this function. Open
return String.prototype.toString;
Avoid too many return
statements within this function. Open
return ""; //no formatter, use empty string, this should *NEVER* happen.
Avoid too many return
statements within this function. Open
return formatter.call(obj,format);
Avoid too many return
statements within this function. Open
return String(source);
Function PhotoCtrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function PhotoCtrl($scope, $resource, $routeParams, Photo) {
var photoResource = Photo;
var routeArgs = {photoId: $routeParams.photoId};
- 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 indexOf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.indexOf = function (what, i) {
i = i || 0;
var L = this.length;
while (i < L) {
if (this[i] === what) return i;
- 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_file_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.check_file_hash(file_path, audio_recording)
# ensure this audio recording needs to be checked
return if audio_recording.status != :to_check
# type of hash is at start of hash_to_compare, split using two colons
- 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_invalid_combinations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_invalid_combinations
# any logged in user can be an owner? No
if self.logged_in && self.owner? && self.user.blank?
errors.add(:user_id, "Owner permissions must be specified with a user id.")
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"