Showing 99 of 2,171 total issues
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
console.log("[render] * props", this.props)
return (
<div className='row'>
Function dateFor
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
static dateFor(yearDate, msDate, style) {
console.debug("[dateFor] <<<", yearDate, msDate, style)
let dateIn = new Date(msDate || Date.now()),
yearIn = dateIn.getFullYear(),
Method included
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.included base
base.class_eval do
has_many :titles, -> { title }, as: :describable, class_name: :Title
has_many :default_titles, -> { distinct }, through: :kind, source: :names, class_name: :Appellation
has_many :all_titles, ->(this) do
- 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_memo_scripta_for_scripta
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fix_memo_scripta_for_scripta
Scriptum.transaction do
Scriptum.find_each do |s|
begin
if s.memo_scripta.blank? && s.service_scripta.present?
- 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 attrs
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def attrs
@attrs ||=
folders.map do |folder|
fbase = File.basename(folder)
target_path = File.join(now.strftime("%Y"), now.strftime("%m"), now.strftime("%Y%m%d%H%M%S"))
Function getPathsFromState
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getPathsFromState(state) {
console.debug("[getPathsFromState] <<<", state)
console.debug("[getPathsFromState] **", state.calendarySlug, state.memory?.slug, state.eventee, state.gallery)
let calendarySlug = state.query.c?.split(",").length == 1 && state.query.c ||
state.query.c?.split(",")?.length == 0 && state.calendarySlug || null,
Function value
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: (value) => {
const scriptumTable = {
'Prolog': 'Пролог',
'Irmos': 'Ирмос',
'Ikos': 'Икос',
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return [
<div className="fixed-action-btn">
<Steps
enabled={this.state.enabled}
Function onApplyRange
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
onApplyRange() {
let r = this.state.pendingRange,
beginName = this.repathTo(this.props.name, "begin"),
endName = this.repathTo(this.props.name, "end"),
valueDetail, ce,
Method year_date_for
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.year_date_for year_date, date_in, julian
return nil if date_in.blank?
date = [ Time, Date, DateTime ].any? {|c| date_in.is_a?(c) } && date_in || Time.parse(date_in)
if /(?<day>\d+)\.(?<month>\d+)%(?<weekday>\d+)$/ =~ year_date
- 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 set_base_year
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_base_year
types = %w(Resurrection Repose Writing Appearance Translation Sanctification)
event = self.events.to_a.sort_by { |x| (types.index(x.kind) || 100) }.first
Function renderModal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderModal() {
return (
<div className='enrighten'>
<div
key='calendary-form-modal'
Function getUrlsFrom
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getUrlsFrom(calendarySlug, memorySlug, eventeeId) {
console.debug("[getUrlsFrom] <<<", calendarySlug, memorySlug, eventeeId)
console.debug("[getUrlsFrom] **", Object.fromEntries(new URLSearchParams(window.location.search)))
let path = "/" + [calendarySlug, memorySlug, eventeeId].compact().join("/"),
json_path = (path === '/' && 'index' || path) + '.json',
Function matchBound
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
matchBound(date, forward, backward, strictDay, strictMonth, weekDayIn, weekDay, easter, year, baseDateRef) {
let cond = false,
condDate,
baseDate = baseDateRef["date"],
condString = `${weekDayIn && "+weekDayIn == weekDay" || "true"} && date ${baseDate && "<=" || ">="} condDate`
Function getUrlsFrom
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function getUrlsFrom(calendarySlug, memorySlug, eventeeId) {
console.debug("[getUrlsFrom] <<<", calendarySlug, memorySlug, eventeeId)
console.debug("[getUrlsFrom] **", Object.fromEntries(new URLSearchParams(window.location.search)))
let path = "/" + [calendarySlug, memorySlug, eventeeId].compact().join("/"),
json_path = (path === '/' && 'index' || path) + '.json',
- 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 makeTweet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function makeTweet(value, locales, source = 'tweets', filter = null) {
let tweets = 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 sortByArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.sortByArray = function(array, field) {
return this.sort((x, y) => {
let xi = array.indexOf(field ? x[field] : x),
yi = array.indexOf(field ? y[field] : y)
- 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 makeDescription
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function makeDescription(value, locales, source = 'descriptions', filter = null) {
let descriptions = 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
Method fill_in_title_description
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fill_in_title_description
if @title
if title = titles.where(language_code: @language, alphabeth_code: @alphabeth).first
title.update_attribute(:text, @title)
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 dates_to_days
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def dates_to_days dates_in, julian
[dates_in].flatten.map do |date_in|
date = date_in.is_a?(Date) && date_in || Date.parse(date_in)
new_date = date.strftime('%2d.%m')
gap = julian && 13.days || 0
- 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"