zammad/zammad

View on GitHub

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?

Severity: Minor
Found in lib/import/otrs/user.rb - About 55 mins to fix

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)
Severity: Minor
Found in lib/import/otrs/sys_config_factory.rb - About 55 mins to fix

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
Severity: Minor
Found in lib/sequencer/unit/exchange/connection.rb - About 55 mins to fix

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
Severity: Minor
Found in lib/external_credential/google.rb - About 55 mins to fix

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'
Severity: Minor
Found in lib/websocket_server.rb - About 55 mins to fix

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)

Severity: Minor
Found in lib/user_agent.rb - About 55 mins to fix

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
Severity: Minor
Found in lib/report/base.rb - About 55 mins to fix

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
Severity: Minor
Found in lib/report/base.rb - About 55 mins to fix

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]
Severity: Minor
Found in lib/html_sanitizer/scrubber/wipe.rb - About 55 mins to fix

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) => {
Severity: Minor
Found in app/frontend/apps/mobile/pages/ticket/composable/useTicketSubscribe.ts - About 55 mins to fix

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,
Severity: Minor
Found in app/frontend/shared/server/apollo/handler/QueryHandler.ts - About 55 mins to fix

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>>({})
Severity: Minor
Found in app/frontend/shared/components/Form/useMultiStepForm.ts - About 55 mins to fix

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 }) => {
Severity: Minor
Found in app/frontend/shared/form/useFormBlock.ts - About 55 mins to fix

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) {
Severity: Minor
Found in app/frontend/shared/utils/selection.ts - About 55 mins to fix

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> => {
Severity: Minor
Found in app/frontend/shared/stores/locale.ts - About 55 mins to fix

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) {
Severity: Major
Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 50 mins to fix

    Function buildToken has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {
    Severity: Major
    Found in app/assets/javascripts/app/lib/base/codemirror.js - About 50 mins to fix

      Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
      Severity: Major
      Found in app/assets/javascripts/app/lib/base/jsonlint.js - About 50 mins to fix

        Function runMode has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
        Severity: Major
        Found in app/assets/javascripts/app/lib/base/codemirror.js - About 50 mins to fix

          Function coordsBidiPart has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {
          Severity: Major
          Found in app/assets/javascripts/app/lib/base/codemirror.js - About 50 mins to fix
            Severity
            Category
            Status
            Source
            Language