Showing 2,064 of 4,422 total issues
Function _create
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
// Some browsers only repeat keydown events, not keypress events,
// so we use the suppressKeyPress flag to determine if we've already
// handled the keydown event. #7269
// Unfortunately the code for & in keypress is the same as the up arrow,
File tooltip.js
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ========================================================================
* Bootstrap: tooltip.js v3.4.1
* https://getbootstrap.com/docs/3.4/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
Method to_article
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_article(params, user, ticket, channel, article = nil)
if article
Rails.logger.debug { 'Update article from message...' }
else
Method condition_query
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
def condition_query(block_condition)
query_must = []
query_must_not = []
current_user = options[:current_user]
Method stream
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def self.stream
Thread.abort_on_exception = true
auto_reconnect_after = 180
delay_before_reconnect = 70
- 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 log.rb
has 493 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Cti
class Log < ApplicationModel
include HasSearchIndexBackend
self.table_name = 'cti_logs'
Method search
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def search(params)
# get params
query = params[:query]
limit = params[:limit] || 10
- 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 init
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init(plot) {
var selection = {
first: { x: -1, y: -1}, second: { x: -1, y: -1},
show: false,
active: false
File jquery.contenteditable.js
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function ($) {
/*
# mode: textonly/richtext / disable b/i/u/enter + strip on paste
# pasteOnlyText: true
Function drawSeriesLines
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawSeriesLines(series) {
function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
var points = datapoints.points,
ps = datapoints.pointsize,
prevx = null, prevy = null;
Method param_cleanup
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def param_cleanup(params, new_object = false, inside_nested = false, exceptions = true)
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
Method d
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def d(key, escape = nil, escaping: true)
# do validation, ignore some methods
return "\#{#{key} / not allowed}" if !data_key_valid?(key)
- 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 clone_attachments
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def clone_attachments(object_type, object_id, options = {})
existing_attachments = Store.list(
object: object_type,
o_id: object_id,
)
- 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_attributes_by_x_headers
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def set_attributes_by_x_headers(item_object, header_name, mail, suffix = false)
# loop all x-zammad-header-* headers
item_object.attributes.each_key do |key|
- 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 load_data
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def self.load_data(params)
nice = params[:nice] || 0.5
object_manager_attributes = params[:object_manager_attributes]
agents = params[:agents] || 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"
Further reading
Function useEmailInboundForm
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useEmailInboundForm = () => {
const formEmailInbound: ShallowRef<FormRef | undefined> = shallowRef()
const { values, updateFieldValues, formSetErrors, onChangedField } =
useForm<EmailInboundData>(formEmailInbound)
File ticket-mocks.ts
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
import { mockGraphQLApi } from '#tests/support/mock-graphql-api.ts'
import { nullableMock } from '#tests/support/utils.ts'
Function Deferred
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
Deferred: function( func ) {
var tuples = [
// action, add listener, callbacks,
// ... .then handlers, argument index, [final state]
File user_agent.rb
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'net/http'
require 'net/https'
require 'net/ftp'
class UserAgent
Method perform_triggers
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def self.perform_triggers(ticket, article, triggers, item, options = {})
recursive = Setting.get('ticket_trigger_recursive')
type = options[:type] || item[:type]
local_options = options.clone
local_options[:type] = type
- 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"