Showing 2,063 of 4,240 total issues
Method groups_from_otrs_group
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def groups_from_otrs_group(role_object, group)
result = []
return result if role_object.blank?
return result if role_object['GroupIDs'].blank?
- 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 import
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def import(settings, *_args)
settings.each do |setting|
next if direct_copy?(setting)
next if number_generator?(setting)
next if postmaster_default?(setting)
- 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 initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(auth, opts = {})
auth = auth.dup
@auth_type = auth[:type]
@auth_token = @auth_type == 'oauth' ? auth[:token] : nil
- 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 request_account_to_link
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.request_account_to_link(credentials = {}, app_required = true)
external_credential = ExternalCredential.find_by(name: 'google')
raise Exceptions::UnprocessableEntity, __('There is no Google app configured.') if !external_credential && app_required
if external_credential
- 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 log
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.log(level, data, client_id = '-')
skip_log = true
case level
when 'error'
- 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 ftp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.ftp(uri, options)
host = uri.host
filename = File.basename(uri.path)
remote_dir = File.dirname(uri.path)
- 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 time_min
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.time_min(data)
query, bind_params, tables = Ticket.selector2sql(data[:condition])
ticket_list = Ticket.where('tickets.created_at >= ? AND tickets.created_at <= ?', data[:start], data[:end])
.where(query, *bind_params).joins(tables)
time_min = 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
Method time_max
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.time_max(data)
query, bind_params, tables = Ticket.selector2sql(data[:condition])
ticket_list = Ticket.where('tickets.created_at >= ? AND tickets.created_at <= ?', data[:start], data[:end])
.where(query, *bind_params).joins(tables)
time_max = 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
Method move_attrs_to_css
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def move_attrs_to_css(node)
attributes_2_css.each do |key|
next if !node[key]
value = node[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
Function useTicketSubscribe
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const useTicketSubscribe = (ticket: Ref<TicketById | undefined>) => {
const { isTicketAgent } = useTicketView(ticket)
const canManageSubscription = computed(() => isTicketAgent.value)
const createTicketCacheUpdater = (subscribed: boolean) => {
- 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 query
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public async query(
options: Omit<QueryOptions<TVariables, TResult>, 'query'> = {},
) {
const {
options: defaultOptions,
- 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 useMultiStepForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const useMultiStepForm = (
formNode: ComputedRef<FormKitNode | undefined>,
) => {
const activeStep = ref('')
const internalSteps = reactive<Record<string, InternalMultiFormSteps>>({})
- 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 useFormBlock
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const useFormBlock = (
context: Ref<FormFieldContext>,
cb: (e: MouseEvent) => void,
) => {
const receipt = context.value.node.on('block-click', ({ payload }) => {
- 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 getCurrentSelectionData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getCurrentSelectionData = (): SelectionData => {
let text = ''
let html = ''
let sel: Selection | null = null
if (window.getSelection) {
- 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 useLocaleStore
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
() => {
const localeData = ref<Maybe<Locale>>(null)
const locales = ref<Maybe<LocalesQuery['locales']>>(null)
const loadLocales = async (): Promise<void> => {
- 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 plotBars
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function plotBars(datapoints, barLeft, barRight, offset, fillStyleCallback, axisx, axisy) {
Function buildToken
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {
Function performAction
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
Function runMode
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
Function coordsBidiPart
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {