Showing 1,209 of 2,501 total issues
File types.ts
has 2340 lines of code (exceeds 250 allowed). Consider refactoring. Open
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
File FieldTreeSelect.spec.ts
has 1229 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
import { cloneDeep, keyBy } from 'lodash-es'
import {
getAllByRole,
File FieldTreeSelect.spec.ts
has 1103 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
import { cloneDeep, keyBy } from 'lodash-es'
import { getByText, waitFor } from '@testing-library/vue'
import { FormKit } from '@formkit/vue'
File FieldSelect.spec.ts
has 1092 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
import type { SetRequired } from 'type-fest'
import { cloneDeep, keyBy } from 'lodash-es'
import {
File FieldSelect.spec.ts
has 1010 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
import type { SetRequired } from 'type-fest'
import { cloneDeep, keyBy } from 'lodash-es'
import { getByText, waitFor } from '@testing-library/vue'
File user.rb
has 879 lines of code (exceeds 250 allowed). Consider refactoring. Open
class User < ApplicationModel
include CanBeImported
include HasActivityStreamLog
include ChecksClientNotification
include HasHistory
File attribute.rb
has 832 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ObjectManager::Attribute < ApplicationModel
include HasDefaultModelUserRelations
include ChecksClientNotification
include CanSeed
Method csv_import
has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring. Open
def csv_import(data)
try = data[:try].to_s == 'true'
delete = data[:delete].to_s == 'true'
begin
- 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 association_name_to_id_convert
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
def association_name_to_id_convert(params)
if params.respond_to?(:permit!)
params = params.permit!.to_h
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
File email_parser.rb
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Channel::EmailParser
include Channel::EmailHelper
PROCESS_TIME_MAX = 180
EMAIL_REGEX = %r{.+@.+}
File twitter_sync.rb
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'http/uri'
class TwitterSync
STATUS_URL_TEMPLATE = 'https://twitter.com/_/status/%s'.freeze
File search_index_backend.rb
has 758 lines of code (exceeds 250 allowed). Consider refactoring. Open
class SearchIndexBackend
SUPPORTED_ES_VERSION_MINIMUM = '7.8'.freeze
SUPPORTED_ES_VERSION_LESS_THAN = '9'.freeze
File guided-setup-manual-channel-email.spec.ts
has 727 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
import { getNode } from '@formkit/core'
import {
getByLabelText,
Method condition_query
has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring. Open
def condition_query(block_condition)
query_must = []
query_must_not = []
current_user = options[:current_user]
- 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 users_controller.rb
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
class UsersController < ApplicationController
include ChecksUserAttributesByCurrentUserPermission
include CanPaginate
prepend_before_action -> { authorize! }, only: %i[import_example import_start search history unlock]
Method config
has 303 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.config
config = {}
config[:metric] = {}
config[:metric][:count] = {
Method perform
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
def perform
# return if we run import mode
return if Setting.get('import_mode')
return if @item[:object] != 'Ticket'
- 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 fill_db.rb
has 666 lines of code (exceeds 250 allowed). Consider refactoring. Open
module FillDb
=begin
fill your database with demo records
Function useTicketEditForm
has 288 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useTicketEditForm = (
ticket: Ref<TicketById | undefined>,
form: Ref<FormRef | undefined>,
) => {
const ticketArticleTypes = computed(() => {
File telegram_helper.rb
has 645 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'telegram/bot'
class TelegramHelper
attr_accessor :client