zammad/zammad

View on GitHub
app/frontend/apps/mobile/pages/ticket/composable/useTicketEditForm.ts

Summary

Maintainability
D
2 days
Test Coverage

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(() => {
Severity: Major
Found in app/frontend/apps/mobile/pages/ticket/composable/useTicketEditForm.ts - About 1 day to fix

    Function useTicketEditForm has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    export const useTicketEditForm = (
      ticket: Ref<TicketById | undefined>,
      form: Ref<FormRef | undefined>,
    ) => {
      const ticketArticleTypes = computed(() => {
    Severity: Minor
    Found in app/frontend/apps/mobile/pages/ticket/composable/useTicketEditForm.ts - About 4 hrs 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

    File useTicketEditForm.ts has 312 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
    
    import { computed, shallowRef } from 'vue'
    import type { Ref } from 'vue'
    import type { FormKitNode } from '@formkit/core'
    Severity: Minor
    Found in app/frontend/apps/mobile/pages/ticket/composable/useTicketEditForm.ts - About 3 hrs to fix

      Function articleTypeChangeHandler has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const articleTypeChangeHandler = () => {
          const executeHandler = (
            execution: FormHandlerExecution,
            schemaData: ReactiveFormSchemData,
            changedField?: ChangedField,

        There are no issues that match your filters.

        Category
        Status