KumbiaPHP/KumbiaPHP

View on GitHub
core/extensions/helpers/form.php

Summary

Maintainability
C
1 day
Test Coverage

Form has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

class Form
{
    /**
     * Utilizado para generar los id de los radio button,
     * lleva un conteo interno.
Severity: Minor
Found in core/extensions/helpers/form.php - About 4 hrs to fix

    Method select has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function select($field, $data, $attrs = '', $value = null, $blank = '', $itemId = 'id', $show = '')
    Severity: Major
    Found in core/extensions/helpers/form.php - About 50 mins to fix

      Method dbSelect has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function dbSelect($field, $show = null, $data = null, $blank = 'Seleccione', $attrs = '', $value = null)
      Severity: Minor
      Found in core/extensions/helpers/form.php - About 45 mins to fix

        Method tag has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected static function tag($tag, $field, $attrs = '', $value = '', $extra = '', $close = true)
        Severity: Minor
        Found in core/extensions/helpers/form.php - About 45 mins to fix

          Function getField has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getField($field, $value = null, $is_check = false, $filter = true, $check = false)
              {
                  // Obtiene considerando el patrĂ³n de formato form.field
                  $formField = explode('.', $field, 2);
                  [$id, $name] = self::fieldName($formField);
          Severity: Minor
          Found in core/extensions/helpers/form.php - About 45 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 getField has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function getField($field, $value = null, $is_check = false, $filter = true, $check = false)
          Severity: Minor
          Found in core/extensions/helpers/form.php - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status