Showing 99 of 2,171 total issues
File memory.rb
has 629 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Memory < ActiveRecord::Base
extend TotalSize
extend DefaultKey
extend Informatible
include WithTitles
File memoryMeta.jsx
has 607 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { matchLanguages, matchAlphabeths, matchLetters, matchEmptyObject, matchCodes, matchEmptyCollection, matchValidUrl } from 'matchers'
import { makeCouncil, makeDate, makeDescription } from 'makers'
export const memoryMeta = {
default: 'short_name',
File memo.rb
has 535 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'when_easter'
# class Memo содержит сведения о помине какой-либо памяти в календаре,
# таким образом связывая память и календарь. Может быть либо прямым обычным помином,
# содержащим поле годовой даты year_date, либо соборным помином, таким
File languageble.rb
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Languageble
extend ActiveSupport::Concern
OLD_RUSSIAN_CAPITAL = 'А-ЬЮЄЅІЇѠѢѤѦѨѪѬѮѰѲѴѸѺꙀꙂꙆꙈꙊꙐꙒꙖ'
OLD_RUSSIAN_STROKE = 'а-ьюєѕіїѡѣѥѧѩѫѭѯѱѳѵѹѻꙁꙃꙇꙉꙋꙑꙓꙗ'
File memoMeta.jsx
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { matchLanguages, matchAlphabeths, matchLetters, matchEmptyObject, matchCodes, matchEmptyCollection } from 'matchers'
import UrlRegexp from 'UrlRegexp'
export const memoMeta = {
default: 'memory',
Method total_size
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def total_size
model = self.name.constantize
rela = self.except(:limit, :offset)
return totals(rela) #TODO
pure = rela.except(:group, :order, :select, :joins, :left_outer_joins)
- 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
File event.rb
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Event < ActiveRecord::Base
extend Informatible
extend TotalSize
include WithTitles
include WithDescriptions
File DynamicField.jsx
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component } from 'react'
import PropTypes from 'prop-types'
import { mixin, flow } from 'lodash-decorators'
import { Autocomplete } from 'materialize-css'
import axios from 'axios'
Function matchLetters
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function matchLetters(textIn, context) {
let res = false, text = textIn || ""
console.debug("[matchLetters] ** text:", text, "context:", context)
File calendaryMeta.jsx
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { matchLanguages, matchAlphabeths, matchLetters, matchEmptyObject, matchCodes, matchEmptyCollection, matchValidJson, matchValidUrl } from 'matchers'
import { makeTitle } from 'makers'
import UrlRegexp from 'UrlRegexp'
export const calendaryMeta = {
File orderMeta.jsx
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { matchLanguages, matchAlphabeths, matchLetters, matchEmptyObject,
matchCodes, matchEmptyCollection } from 'matchers'
import { makeTweet, makeNote, makeDescription } from 'makers'
import UrlRegexp from 'UrlRegexp'
Function renderElement
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export function renderElement(element, meta) {
console.debug("[renderElement] << element:", element, "meta:", meta)
let mapped = Object.getOwnPropertyNames(meta).reduce((metaResult, nameIn) => {
let forIn = meta[nameIn].for,
- 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_each
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def validate_each(record, attribute, value)
options.each do |(type, sub_options)|
value_in =
case type
when :width, :height
- 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
Class CommonController
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Admin::CommonController < ApplicationController
include ::Auth
include ::Pundit::Authorization
before_action :authenticate_user!, except: %i(dashboard)
DynamicField
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
@mixin(Subscribed)
@mixin(Validation)
@mixin(ValueToObject)
@mixin(RepathTo)
export default class DynamicField extends Component {
Class ImageSyncService
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class ImageSyncService
attr_reader :targets, :source, :storage, :asset_path
def initialize source: nil, targets: [], asset_path: nil, storage: nil
@source = source # path
Function renderElement
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function renderElement(element, meta) {
console.debug("[renderElement] << element:", element, "meta:", meta)
let mapped = Object.getOwnPropertyNames(meta).reduce((metaResult, nameIn) => {
let forIn = meta[nameIn].for,
Method total_size
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def total_size
model = self.name.constantize
rela = self.except(:limit, :offset)
return totals(rela) #TODO
pure = rela.except(:group, :order, :select, :joins, :left_outer_joins)
Method included
has 78 lines of code (exceeds 25 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
Method convert_icon_links_into_images
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def convert_icon_links_into_images
uri = URI.join(Rails.application.routes.url_helpers.root_url, "/api/v1/images/create.json")
links = Link.where(type: ["IconLink", "PhotoLink"]).find_each do |l|
url = Addressable::URI.parse(l.url).normalize.to_s
- 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"