antaresproject/core

View on GitHub

Showing 265 of 306 total issues

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

    protected function compileClasses()
    {
        $preloader = (new Factory())->create(['skip' => true]);

        $path = $this->laravel->getCachedCompilePath();
Severity: Minor
Found in src/foundation/src/Console/Commands/OptimizeCommand.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 compileColumnQuery has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function compileColumnQuery($query, $method, $parameters, $column, $keyword)
Severity: Minor
Found in src/ui/components/datatables/src/Engines/QueryBuilderEngine.php - About 35 mins to fix

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

        protected function evaluateAsset($asset, $value, $original, &$sorted, &$assets)
    Severity: Minor
    Found in src/utils/asset/src/DependencyResolver.php - About 35 mins to fix

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

          public function inlineScript($name, $source = null, $dependencies = [], $attributes = [], $replaces = [])
      Severity: Minor
      Found in src/utils/asset/src/Asset.php - About 35 mins to fix

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

            public function script($name, $source, $dependencies = [], $attributes = [], $replaces = [])
        Severity: Minor
        Found in src/utils/asset/src/Asset.php - About 35 mins to fix

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

              protected function buffer(&$buffer, $elements, $item, $after, $current)
          Severity: Minor
          Found in src/components/support/src/Support/Nesty.php - About 35 mins to fix

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

                protected function show($param, $type = null, $width = 40, $height = 40, $widget = false)
            Severity: Minor
            Found in src/utils/twig/Extension/Avatar.php - About 35 mins to fix

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

                  public function style($name, $source, $dependencies = [], $attributes = [], $replaces = [])
              Severity: Minor
              Found in src/utils/asset/src/Asset.php - About 35 mins to fix

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

                    public function add($name, $source, $dependencies = [], $attributes = [], $replaces = [])
                Severity: Minor
                Found in src/utils/asset/src/Asset.php - About 35 mins to fix

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

                      protected function checkable($type, $name, $value, $checked, $options)
                  Severity: Minor
                  Found in src/components/html/src/Support/Traits/CheckerTrait.php - About 35 mins to fix

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

                        public function selectYear($name, $begin, $end, $selected = null, $options = [])
                    Severity: Minor
                    Found in src/components/html/src/Support/Traits/SelectionTrait.php - About 35 mins to fix

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

                          public function selectRange($name, $begin, $end, $selected = null, $options = [])
                      Severity: Minor
                      Found in src/components/html/src/Support/Traits/SelectionTrait.php - About 35 mins to fix

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

                            public function allow($roles, $actions, $allow = true, $descriptions = null, $categories = null)
                        Severity: Minor
                        Found in src/components/auth/src/Authorization/Authorization.php - About 35 mins to fix

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

                              public function checkboxes($name, array $list = [], $checked = null, array $options = [], $separator = '<br>')
                          Severity: Minor
                          Found in src/components/html/src/FormBuilder.php - About 35 mins to fix

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

                                public function select($name, $list = [], $selected = null, $options = [], $optionsData = [])
                            Severity: Minor
                            Found in src/components/html/src/Support/Traits/SelectionTrait.php - About 35 mins to fix

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

                                  protected function generateCheckboxByGroup($id, $label, $name, $checked, array $options)
                              Severity: Minor
                              Found in src/components/html/src/FormBuilder.php - About 35 mins to fix

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

                                    protected function addContent($message, $view, $plain, $raw, $data)
                                Severity: Minor
                                Found in src/components/notifier/src/Mail/Mailer.php - About 35 mins to fix

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

                                      protected function save($key, $value, $isNew = false, $brandId = false, $flag = null)
                                  Severity: Minor
                                  Found in src/components/memory/src/Handlers/Component.php - About 35 mins to fix

                                    Function componentsList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function componentsList()
                                        {
                                            $function = function () {
                                    
                                                $widgets = app('antares.widget')->make('menu.top.right')->items();
                                    Severity: Minor
                                    Found in src/ui/components/templates/src/Twig/Component.php - About 35 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 addColumn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        public function addColumn(array $attributes)
                                        {
                                            $query  = $this->getQuery();
                                            $orders = $query instanceof \Illuminate\Database\Eloquent\Builder ? $query->getQuery()->orders : null;
                                            if (!isset($this->attributes['order']) and ! is_null($query) and ! is_null($orders)) {
                                    Severity: Minor
                                    Found in src/ui/components/datatables/src/Html/Builder.php - About 35 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language