antaresproject/core

View on GitHub

Showing 265 of 306 total issues

Function getFunctions has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFunctions()
    {
        return [
            new Twig_SimpleFunction('memorize', function ($key, $default = null) {
                        return app('antares.platform.memory')->get($key, $default);
Severity: Minor
Found in src/utils/twig/Extension/Foundation.php - About 3 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

Function argumentsToString has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    protected function argumentsToString($args)
    {
        $count = 0;

        $isAssoc = $args !== array_values($args);
Severity: Minor
Found in src/components/exception/Handler.php - About 3 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

Function render has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function render($request, Exception $e)
    {
        if ($e instanceof ValidationException) {
            return parent::render($request, $e);
        }
Severity: Minor
Found in src/components/exception/Handler.php - About 3 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

Function columnSearch has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function columnSearch()
    {
        $columns = $this->request->get('columns', []);

        foreach ($columns as $index => $column) {
Severity: Minor
Found in src/ui/components/datatables/src/Engines/QueryBuilderEngine.php - About 2 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

Function getRecipients has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecipients()
    {
        if (empty($this->recipients)) {
            return [];
        }
Severity: Minor
Found in src/components/view/src/Notification/AbstractNotificationTemplate.php - About 2 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 Fieldset.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Part of the Antares package.
 *
Severity: Minor
Found in src/components/html/src/Form/Fieldset.php - About 2 hrs to fix

    Method updatePermissions has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function updatePermissions($name, $values, $isNew = false, $brandId = null)
        {
            try {
                if ($name === null) {
                    return false;
    Severity: Major
    Found in src/components/memory/src/Model/Permission.php - About 2 hrs to fix

      Method up has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function up()
          {
              $this->down();
      
              Schema::create('tbl_notifications', function(Blueprint $table) {

        File JSMin.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Part of the Antares package.
         *
        Severity: Minor
        Found in src/utils/asset/src/JSMin.php - About 2 hrs to fix

          File Foundation.php has 278 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Part of the Antares package.
           *
          Severity: Minor
          Found in src/utils/twig/Extension/Foundation.php - About 2 hrs to fix

            Fieldset has 24 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Fieldset extends BaseGrid implements FieldsetContract
            {
            
                /**
                 * Fieldset name.
            Severity: Minor
            Found in src/components/html/src/Form/Fieldset.php - About 2 hrs to fix

              AbstractNotificationTemplate has 24 functions (exceeds 20 allowed). Consider refactoring.
              Open

              abstract class AbstractNotificationTemplate extends Job implements NotificationContract, ShouldQueue
              {
              
                  use InteractsWithQueue,
                      SerializesModels;
              Severity: Minor
              Found in src/components/view/src/Notification/AbstractNotificationTemplate.php - About 2 hrs to fix

                HtmlBuilder has 24 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class HtmlBuilder
                {
                
                    use Macroable,
                        ObfuscateTrait;
                Severity: Minor
                Found in src/components/html/src/Support/HtmlBuilder.php - About 2 hrs to fix

                  Function verify has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function verify(array $items = [], $brandId = null)
                      {
                  
                          $items   = $this->clear($items);
                          $changed = [];
                  Severity: Minor
                  Found in src/components/memory/src/Component/ComponentHandler.php - About 2 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 User.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Part of the Antares package.
                   *
                  Severity: Minor
                  Found in src/components/model/src/User.php - About 2 hrs to fix

                    Function attributes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function attributes(FieldView $field)
                        {
                            if (is_null($field)) {
                                return $this;
                            }
                    Severity: Minor
                    Found in src/utils/customfield/src/CustomField.php - About 2 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

                    Function wrap_html has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function wrap_html($str, $size = 50, $splitter = '<br />')
                        {
                            $html   = false;
                            $i      = 0;
                            $chars  = str_split($str);
                    Severity: Minor
                    Found in src/foundation/src/helpers.php - About 2 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

                    Method attributes has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function attributes(FieldView $field)
                        {
                            if (is_null($field)) {
                                return $this;
                            }
                    Severity: Major
                    Found in src/utils/customfield/src/CustomField.php - About 2 hrs to fix

                      Method inline has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function inline()
                          {
                              $inline = <<<EOD
                                 $(document).ready(function(){                         
                                  var element =null;
                      Severity: Major
                      Found in src/ui/components/templates/src/Adapter/GridStackAdapter.php - About 2 hrs to fix

                        Method beforeTable has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function beforeTable()
                            {
                                $hasMassActions  = $this->hasMassActions();
                                $filters         = $this->filterAdapter->getFilters();
                                $hasColumnFilter = $this->hasColumnFilter();
                        Severity: Major
                        Found in src/ui/components/datatables/src/Html/Builder.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language