Showing 257 of 469 total issues
File emoji_table.js
has 575 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export default {
'common': {
'slight_smile': '🙂',
'heart': '❤️',
'tada': '🎉',
Method import
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.import(filename_or_url, reset_keys: false)
group_ids = []
migrate_ids = {}
if URI.parse(filename_or_url).class == URI::Generic
- 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 actions
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
actions(group) {
const membership = group.membershipFor(Session.user());
return {
email_group: {
Function actions
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
actions(poll, vm, event) {
if (!poll || !poll.config()) { return {}; }
return {
translate_poll: {
icon: 'mdi-translate',
Function actions
has 221 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
actions(discussion, vm) {
return {
make_a_copy: {
icon: 'mdi-content-copy',
name: 'templates.make_a_copy',
`` has 61 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default new class AbilityService {
isNotEmailVerified() {
return Session.isSignedIn() && !Session.user().emailVerified;
}
Method route
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.route(email)
return nil unless email.route_address
return nil if email.released
return nil if email.sender_hostname.downcase == ENV['REPLY_HOSTNAME'].downcase
return nil if email.sender_hostname.downcase == ENV['SMTP_DOMAIN'].downcase
- 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
DiscussionModel
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class DiscussionModel extends BaseModel {
static singular = 'discussion';
static plural = 'discussions';
static uniqueIndices = ['id', 'key'];
static indices = ['groupId', 'authorId'];
GroupModel
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class GroupModel extends BaseModel {
static singular = 'group';
static plural = 'groups';
static uniqueIndices = ['id', 'key'];
static indices = ['parentId'];
Class SnorlaxBase
has 53 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class API::V1::SnorlaxBase < ActionController::Base
rescue_from(CanCan::AccessDenied) { |e| respond_with_standard_error e, 403 }
rescue_from(ActionController::UnpermittedParameters) { |e| respond_with_standard_error e, 400 }
rescue_from(ActionController::ParameterMissing) { |e| respond_with_standard_error e, 400 }
rescue_from(ActiveRecord::RecordNotFound) { |e| respond_with_standard_error e, 404 }
Class Poll
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Poll < ApplicationRecord
extend HasCustomFields
include CustomCounterCache::Model
include ReadableUnguessableUrls
include HasEvents
PollModel
has 52 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class PollModel extends BaseModel {
static singular = 'poll';
static plural = 'polls';
static uniqueIndices = ['id', 'key'];
static indices = ['discussionId', 'authorId', 'groupId'];
File thread_loader.js
has 445 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Records from '@/shared/services/records';
import { some, last, cloneDeep, max, uniq, compact, orderBy } from 'lodash-es';
import Vue from 'vue';
import RangeSet from '@/shared/services/range_set';
import EventBus from '@/shared/services/event_bus';
File poll.rb
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class Poll < ApplicationRecord
extend HasCustomFields
include CustomCounterCache::Model
include ReadableUnguessableUrls
include HasEvents
Class Group
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Group < ApplicationRecord
include HasTimeframe
include HasRichText
include CustomCounterCache::Model
include ReadableUnguessableUrls
File group.rb
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class Group < ApplicationRecord
include HasTimeframe
include HasRichText
include CustomCounterCache::Model
include ReadableUnguessableUrls
File record_cloner.rb
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class RecordCloner
def initialize(recorded_at:)
@recorded_at = recorded_at
@cache = {}
end
BaseModel
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default class BaseModel {
static singular = 'undefinedSingular';
static plural = 'undefinedPlural';
static eventTypeMap = {
File fake_data_helper.rb
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Dev::FakeDataHelper
private
def saved(obj)
obj.tap(&:save!)
Function actions
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
actions(comment, vm, event) {
const isOwnComment = comment.authorId === Session.userId;
return {
translate_comment: {
name: 'common.action.translate',