Showing 2,063 of 4,240 total issues
Function change
has 331 lines of code (exceeds 25 allowed). Consider refactoring. Open
change: function (shiftKey, originalEvent) {
var options = this.options;
var aspectRatio = options.aspectRatio;
var action = this.action;
var container = this.container;
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 ua-parser.js
has 703 lines of code (exceeds 250 allowed). Consider refactoring. Open
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v1.0.34
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
File bootstrap-tokenfield.js
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* bootstrap-tokenfield
* https://github.com/sliptree/bootstrap-tokenfield
* Copyright 2013-2014 Sliptree and other contributors; Licensed MIT
*
File exif.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function() {
var debug = false;
var root = this;
File users_controller.rb
has 679 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
Function useEmailChannelConfiguration
has 282 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useEmailChannelConfiguration = (
emailChannelForms: EmailChannelForms,
metaInformationInbound: Ref<Maybe<EmailInboundMetaInformation>>,
updateMetaInformationInbound: UpdateMetaInformationInboundFunction,
onSuccessCallback: () => void,
Method perform
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def perform
# return if we run import mode
return if Setting.get('import_mode')
- 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 process_webhook
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def process_webhook(channel)
Rails.logger.debug { 'import tweet' }
ticket = nil
if @payload['direct_message_events'].present? && channel.options[:sync][:direct_messages][:group_id].present?
@payload['direct_message_events'].each do |item|
- 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 277 lines of code (exceeds 25 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
File qrcodegen.js
has 624 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* QR Code generator library (compiled from TypeScript)
*
* Copyright (c) Project Nayuki. (MIT License)
* https://www.nayuki.io/page/qr-code-generator-library
Method run
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
def self.run(_channel, mail, _transaction_params)
return if mail[:'x-zammad-ticket-id']
# get ticket# from subject
- 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_helper.rb
has 615 lines of code (exceeds 250 allowed). Consider refactoring. Open
class EmailHelper
=begin
get available driver
Method csv_example
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
def csv_example(params = {})
header = []
records = where.not(id: csv_object_ids_ignored).offset(1).limit(23).to_a
if records.count < 20
record_ids = records.pluck(:id).concat(csv_object_ids_ignored)
- 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 setDocument
has 262 lines of code (exceeds 25 allowed). Consider refactoring. Open
setDocument = Sizzle.setDocument = function( node ) {
var hasCompare, subWindow,
doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected