zammad/zammad

View on GitHub

Showing 2,064 of 4,422 total issues

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 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 selectors has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.selectors(index, selectors = nil, options = {}, aggs_interval = nil)
    raise 'no selectors given' if !selectors

    url = build_url(type: index, action: '_search', with_pipeline: false, with_document_type: false)
    return if url.blank?
Severity: Minor
Found in lib/search_index_backend.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 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 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 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

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])

    time_max = 0
    ticket_ids = []
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_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])

    time_min = 0
    ticket_ids = []
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

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 visitViewAndMockPasswordConfirmation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const visitViewAndMockPasswordConfirmation = async (
  recoveryCodesExist: boolean,
  configuration: Configuration,
  flyoutHeading = /Set up Two-factor Authentication: Confirm Password/i,
) => {

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 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 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 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 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 coordsBidiPartWrapped has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {
    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

        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 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
            Severity
            Category
            Status
            Source
            Language