Showing 739 of 12,579 total issues
Consider simplifying this complex logical expression. Open
if ($&.nil?) or
(isbn_10.nil? and isbn_13.nil?) or
((isbn_10.nil? and type == '10') or (isbn_13.nil? and type == '13'))
errors.add(:identifier, "'#{identifier}' has the wrong number of digits.")
return
Consider simplifying this complex logical expression. Open
if !t.end_with?('us') &&
!t.end_with?('a') &&
!t.end_with?('um') &&
!t.end_with?('is') &&
!t.end_with?('e') &&
Consider simplifying this complex logical expression. Open
if !t.end_with?('us') &&
!t.end_with?('a') &&
!t.end_with?('um') &&
!t.end_with?('is') &&
!t.end_with?('e') &&
Function get_first_name
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
get_first_name: function (string) {
// if there is no space or , there is no first name
if ((string.indexOf(",") > 1) || (string.indexOf(" ") > 1)) {
var delimiter;
- 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 URLParamsToJSON
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const URLParamsToJSON = function (query) {
if (query.indexOf('?') < 0) return {}
query = query.substring(query.indexOf('?') + 1)
return qs.parse(query, {
- 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 buildFeatureCollectionFromShape
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
buildFeatureCollectionFromShape: function (shape, shape_type) {
// var featureCollection = [];
var feature = [];
var coordinates = [];
- 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 showchildren
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
CarrouselTask.prototype.showchildren = function (childIndex) {
var count = 0
if (typeof childIndex !== 'undefined') {
if (childIndex > this.active.length - this.maxCards) {
- 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 singleDrawnFeatureToMapListeners
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
singleDrawnFeatureToMapListeners: function (this_map, map_item, feature_control) {
google.maps.event.addListener(this_map[1], 'overlaycomplete', function (event) {
// Remove the last created shape if it exists.
if (map_item != null) {
if (map_item[0] != null) {
- 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 update_catalog_number_collection_code_namespace
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_catalog_number_collection_code_namespace(collection_code, namespace_id)
return if collection_code.nil? # No support for mapping blank data at this time
transaction do
mapping = get_catalog_number_collection_code_namespace_mapping(collection_code)
- 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 update_fields
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_fields
upsert_fields = @data_field_changed
&.filter_map&.with_index { |c, i| field_db_attributes(i, data_fields[i]) if c } || []
delete_fields = @data_field_changed
&.filter_map&.with_index { |c, i| i if c && data_fields[i].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"
Further reading
Method get_identifier_matrix
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_identifier_matrix
i = increment_matrix
m = []
- 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 container=
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def container=(object)
if object.metamorphosize.kind_of?(Container)
if self.parent
self.parent.contained_object = object
else
- 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_batch_update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def query_batch_update(request)
return false if request.unprocessable?
r = request.stub_response
r.method = 'query_batch_update'
- 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 geographic_area_autocomplete_tag
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def geographic_area_autocomplete_tag(geographic_area, term)
return nil if geographic_area.nil?
if term
s = geographic_area.name.gsub(/#{Regexp.escape(term)}/i, "<mark>#{term}</mark>") + ' '
- 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 get_klass
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_klass
render json: {status: 400} if (params[:type] && params[:global_id]) || (params[:type].blank? && params[:global_id].blank?)
if params[:type]
@klass = params[:type]
- 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 sv_determined_before_collected
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sv_determined_before_collected
ce = collecting_event
return true if ce.nil? || ce.start_date_year.nil?
#ce_date = ce.start_date_year.to_s + '/' + sprintf( '%02d', ce.start_date_month.to_i) + "/" + sprintf( '%02d', ce.start_date_day.to_i)
#ce_date = ce.end_date_year.to_s + '/' + sprintf( '%02d', ce.end_date_month.to_i) + "/" + sprintf( '%02d', ce.end_date_day.to_i) unless ce.end_date_year.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 sandbox_details_tag
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sandbox_details_tag
if Settings.sandbox_mode?
content_tag(:span, class: 'subtle') do
[ 'SANDBOX - build',
(Settings.sandbox_short_commit_sha ?
- 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 save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save
if collection_objects.size == 0
errors = ActiveModel::Errors.new('base')
errors.add(:total, 'No totals provided!')
return false, errors
- 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 autocomplete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def autocomplete
queries = [
autocomplete_exact_name,
#autocomplete_exact_alternate_value,
autocomplete_exact_alternate_value('name', 'AlternateValue::Translation'),
- 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 data_attribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def data_attribute(columns, type = 'import')
r = BatchLoad::ColumnResolver::Result.new
predicate = columns['predicate']
value = columns['value']
- 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"