Showing 98 of 1,256 total issues
Avoid deeply nested control flow statements. Open
if tour_stop["payload"]["mp4"].present? && tour_stop["payload"]["mp4"]["uri"].present?
mp4 = set_defaults_and_types(tour_stop["payload"]["mp4"])
mp4["id"] = "-3"
scene_downloadable_uris.unshift(mp4)
Avoid deeply nested control flow statements. Open
next if downloadable_uri.blank?
Avoid deeply nested control flow statements. Open
if tour_stop["payload"]["quad"].present?
quad = set_defaults_and_types(tour_stop["payload"]["quad"])
quad["id"] = "-6"
quad["height"] = 1000
quad["width"] = 1000
Avoid deeply nested control flow statements. Open
if tour_stop["payload"]["target"].present? && tour_stop["payload"]["target"]["uri"].present?
target = set_defaults_and_types(tour_stop["payload"]["target"])
target["id"] = "-1"
scene_downloadable_uris.unshift(target)
Avoid deeply nested control flow statements. Open
if tour_stop["payload"]["image"].present? && tour_stop["payload"]["image"]["uri"].present?
image = set_defaults_and_types(tour_stop["payload"]["image"])
image["id"] = "-4"
scene_downloadable_uris.unshift(image)
Avoid deeply nested control flow statements. Open
if tour_stop["payload"]["spot"].present?
spot = tour_stop["payload"]["spot"]
spot["id"] = "-7"
spot["shadow_opacity"] = spot["shadow_opacity"].presence || 0.6
spot["inner_angle"] = spot["inner_angle"].presence || 5
Avoid deeply nested control flow statements. Open
if tour_stop["payload"]["start_date"].present? && tour_stop["payload"]["time_period_in_days"].present?
scene = scenes.first
end
Avoid deeply nested control flow statements. Open
if tour_stop["payload"]["light"].present?
light = set_defaults_and_types(tour_stop["payload"]["light"])
light["id"] = "-5"
scene_downloadable_uris.unshift(light)
Function getInitialValue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var getInitialValue = function (formObject, key, arrayPath, tpldata, usePreviousValues) {
Method send_single_pick_up_time
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_single_pick_up_time(date, waste_type, street, zip, city)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(uri, login = nil, password = nil, params = {}, headers = {})
Method build_mutation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_mutation(name, data, update = false, return_keys = "id", is_copy = false)
Avoid too many return
statements within this function. Open
return !!_.some(formField.items, function (item) {
return includeSchemaKey(item, schemaKey);
});
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return _.max(childNumbers) || 0;
Method nested_values?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def nested_values?(value_to_check, result = [])
result << true if value_to_check.class == String && value_to_check.present?
if value_to_check.class == Array
value_to_check.each do |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"
Further reading
Method visibility_location_href
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def visibility_location_href(item, item_class)
return "location.href = '/visibility/#{item_class}/#{item.id}/#{item.visible ? 'false' : 'true'}/#{item.survey_poll_id}';" if item_class === "Survey_Comment"
"location.href = '/visibility/#{item_class}/#{item.id}/#{item.visible ? 'false' : 'true'}';"
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 nested_values?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def nested_values?(value_to_check, result = [])
result << true if value_to_check.class == String && value_to_check.present?
if value_to_check.class == Array
value_to_check.each do |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"