Showing 99 of 2,171 total issues
Method included
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.included base
base.class_eval do
has_many :descriptions, -> { where(type: :Description) }, as: :describable, dependent: :delete_all do
def for language_codes
where(language_code: language_codes).first
- 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 makeNote
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function makeNote(value, locales, source = 'notes', filter = null) {
let notes = locales.map((locale) => {
return value[source].reduce((res, text) => {
return res ||
locale === text.language_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
Function matchValidJson
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function matchValidJson(text) {
if (text) {
switch (text.constructor.name) {
case "String":
try {
- 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 copy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy source, target, type, kind, scheme
Method validates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validates scheme
scheme[:attrs].each do |a|
duped = duped(a)
error("Invalid height of image file #{a[:source]}") if a[:kind] == :invalid
- 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 fix_root_in_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fix_root_in_names
Name.all.each do |name|
line = [ name ]
last = name
- 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 targets=
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def targets= value
if value.kind_of?( Array )
new_value = value.map do |v|
if v.kind_of?(String) && v =~ /^\^(.*)/
Memory.where(short_name: $1).first
- 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 year_date_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def year_date_for year
case year_date
when /(?<sign>[+-])(?<indent>.*)/
mul = sign == '-' && -1 || 1
WhenEaster::EasterCalendar.find_greek_easter_date(year.to_i) + (mul * indent.to_i).days
- 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 onChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onChange(e) {
let humanized_value = e.target.value
console.log("[onChange] * update to", humanized_value)
this.updateTo(humanized_value, false)
- 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 proceed_joins
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def proceed_joins joins, default_type = :inner
joins.reduce({}) do |res, join|
_outer = false
name =
- 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 filterMap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.filterMap = function(func) {
return this.reduce(([res, index], key) => {
if (func && func.constructor.name === "Function") {
let value = func(key, index)
- 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 draw_memoes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def draw_memoes
grouped.each do |(date, date_memoes)|
memo = date_memoes.reject { |m| m.descriptions.empty? }.first
next if !memo
- 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 yearDateFromDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function yearDateFromDate(date_in) {
console.debug("[yearDateFromDate] <<<", date_in)
let date, yearDate
- 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 onSuccessLoad
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
onSuccessLoad(response) {
let new_records, new_page, new_state, records = response.data
console.log("[onSuccessLoad] > response", response)
console.log("[onSuccessLoad] > records", records)
- 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 activeClassFor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
activeClassFor(memo) {
if (this.indexActiveMemo() >= 0) {
if (memo.calendary_slug == this.props.defaultCalendarySlug) {
return "active"
}
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize source: nil, targets: [], asset_path: nil, storage: nil
@source = source # path
@targets = targets # paths
@asset_path = asset_path || '/images'
@storage = Rails.root.join(storage || 'public/images')
- 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 getFirstName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static getFirstName(props, namesIn) {
let preprios = [
'благословенное',
'схимное',
'иноческое',
- 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 renderValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderValue() {
if (this.props.value) {
switch (this.props.value.constructor.name) {
case "String":
try {
- 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 populateTo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
String.prototype.populateTo = function(string) {
let from = this.charCodeAt(0),
to = string.charCodeAt(0),
res = []
- 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"