Showing 700 of 1,230 total issues
Function renderImagePlaceholder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
window.ST.renderImagePlaceholder = function() {
var template = $("#new-image-tmpl").html();
var element = $(template);
var previewImage = $("img", element).hide();
var removeLink = $('.fileupload-preview-remove-image', element);
- 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 manually_validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function manually_validate(formhint) {
var rray = formhint.split("_");
var form_id = "#";
var _element = "#";
- 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 startRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function startRoute(latitude, longitude) {
var foo = document.getElementById("listing_origin").value;
var bar = document.getElementById("listing_destination").value;
directionsDisplay.setMap(map);
document.getElementById("listing_origin_loc_attributes_address").value = foo;
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const initialize = function initialize(i18nLocale, i18nDefaultLocale, env, localeInfo) {
I18n.locale = i18nLocale;
I18n.defaultLocale = i18nDefaultLocale;
I18n.interpolationMode = 'split';
I18n.localeInfo = localeInfo != null ? localeInfo : { ident: i18nLocale };
- 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 status_title
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def status_title(listing, locale)
status =
if listing.approval_pending? || listing.approval_rejected?
listing.state
elsif listing.valid_until && listing.valid_until < DateTime.current
- 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 validate_selections
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_selections
if question&.for_person?
return true unless question.required?
end
unless custom_field_option_selections.size == 1
- 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 addListingMarkers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function addListingMarkers(listings, viewport) {
// Test requesting location data
// Now the request_path needs to also have a query string with the wanted parameters
markerContents = [];
- 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 initializeNumbro
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const initializeNumbro = _.memoize((numbroInstance, locale) => {
if (locale && _.includes(KNOWN_LOCALES, locale) && locale !== 'en-US') {
numbroInstance.culture(locale, require(`numbro/languages/${locale}`));
} else {
KNOWN_LOCALES.forEach((localeCode) => {
- 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_follow_status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_follow_status(listing, status)
unless id == listing.author.id
if status
follow(listing) unless is_following?(listing)
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
Function render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const extraClasses = this.props.extraClasses ? this.props.extraClasses : '';
const extraClassesLink = this.props.extraClassesLink ? this.props.extraClassesLink : '';
const inlineStyling = this.props.textColor != null ? { style: { color: this.textColor } } : {};
const linkProps = Object.assign({
- 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 _search_many
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self._search_many(with_many, ids=[])
if with_many.length == 0
NumericFieldValue.search_with_listing_ids({}, ids)
elsif (with_many.length == 1)
NumericFieldValue.search_with_listing_ids(with_many.first, ids)
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
const isOpen = this.props.isOpen;
const height = this.props.height ? { height: this.props.height } : {};
const width = calculateWidth({
- 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 setMapCenter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function setMapCenter(communityLat, communityLng, preferCommunityLocation) {
var hasCommunityLocation = communityLat && communityLng;
var useCommunityLocation = hasCommunityLocation && preferCommunityLocation;
function defaultLocation() {
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
document.body.classList.add(css.transitionVisible);
if (this.state.entering) {
document.body.classList.add(css.transitionEntering);
- 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 person_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def person_name(person)
if person.present? && !person.deleted?
display_name = person.display_name.present? ? " (#{person.display_name})" : ''
"#{person.given_name} #{person.family_name}#{display_name}"
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 next_and_prev
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def next_and_prev(arr, curr)
if arr.length <= 1
[nil, nil]
elsif arr.length == 2
first, last = arr
- 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_extra_attributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_extra_attributes
unless cta_enabled
self.button_title = nil
self.button_path = nil
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 preview
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def preview
return if perform_redirect!
com = community(request)
cid = com.id
- 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 per_hour_availability
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def per_hour_availability
return true unless per_hour
self.class.uncached do
unless tx.listing.working_hours_covers_booking?(self) &&
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
Result.all(
-> {
TransactionForm.validate(params.to_unsafe_hash)
},
- 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"