KumbiaPHP/KumbiaPHP

View on GitHub

Showing 61 of 65 total issues

Function generate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function generate($controller)
    {
        // Registra la autocarga de helpers
        spl_autoload_register('kumbia_autoload_helper', true, true);
        // Mapea los atributos del controller en el scope
Severity: Minor
Found in core/kumbia/kumbia_view.php - 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 ifRouted has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function ifRouted(string $url): string
    {
        $routes = Config::get('routes.routes');

        // Si existe una ruta exacta la devuelve
Severity: Minor
Found in core/kumbia/kumbia_router.php - 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 dispatch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function dispatch($argv)
    {
        // Elimino el nombre de archivo del array de argumentos
        array_shift($argv);

Severity: Minor
Found in core/kumbia/console.php - 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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function get($s, $filter, $options = array()) {
        if (is_string($options)) {
            $filters = func_get_args();
            unset($filters[0]);

Severity: Minor
Found in core/libs/filter/filter.php - 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 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

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

        static public function init(Controller $controller) {
            $content = $_SERVER['CONTENT_TYPE'] ?? 'text/html';
            /**
             * Verifico el formato de entrada
             */
    Severity: Minor
    Found in core/libs/rest/rest.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

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

        public static function getParams($params)
        {
            $data = [];
            foreach ($params as $p) {
                if (is_string($p)) {
    Severity: Minor
    Found in core/kumbia/util.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 linkConfirm has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function linkConfirm($action, $text, $update, $confirm, $class = '', $attrs = '')
    Severity: Minor
    Found in core/extensions/helpers/ajax.php - About 45 mins to fix

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

          public function authenticate()
          {
              $this->resource = @fopen($this->filename, "r");
              if ($this->resource === false) {
                  throw new KumbiaException("No existe o no se puede cargar el archivo '{$this->filename}'");
      Severity: Minor
      Found in core/libs/auth/adapters/digest_auth.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

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

          public function __construct($auth, $extra_args)
          {
      
              if (!extension_loaded("radius")) {
                  throw new KumbiaException("Debe cargar la extensión de php llamada radius");
      Severity: Minor
      Found in core/libs/auth/adapters/radius_auth.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 select has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function select($field, $data, $update, $action, $class = '', $attrs = '')
      Severity: Minor
      Found in core/extensions/helpers/ajax.php - About 45 mins to fix

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

            public static function partial($partial, $__time = '', $params = null, $group = 'kumbia.partials')
            {
                if (PRODUCTION && $__time && !Cache::driver()->start($__time, $partial, $group)) {
                    return;
                }
        Severity: Minor
        Found in core/kumbia/kumbia_view.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 linkActionConfirm has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function linkActionConfirm($action, $text, $update, $confirm, $class = '', $attrs = '')
        Severity: Minor
        Found in core/extensions/helpers/ajax.php - About 45 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

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

                public static function data(array $data, array $fields, $filterAll = '') {
                    $filtered = array();//datos filtrados a devolver.
                    foreach ($fields as $index => $filters) {
                        if (is_numeric($index) && array_key_exists($filters, $data)) {
                            //si el indice es numerico, no queremos usar filtro para ese campo
            Severity: Minor
            Found in core/libs/filter/filter.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 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 delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function delete($params, $controller)
                  {
                      // path limpio al controlador
                      $clean_path = trim($controller, '/');
              
              
              Severity: Minor
              Found in core/console/controller_console.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

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

                  public static function linkAction($action, $text, $update, $class = '', $attrs = '')
              Severity: Minor
              Found in core/extensions/helpers/ajax.php - About 35 mins to fix

                Method link has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function link($action, $text, $confirm = '¿Está Seguro?', $class = '', $attrs = '')
                Severity: Minor
                Found in core/extensions/helpers/js.php - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language