madbob/GASdottoNG

View on GitHub

Showing 494 of 494 total issues

File UsersService.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App\Services;

use App\Exceptions\AuthException;
Severity: Minor
Found in code/app/Services/UsersService.php - About 2 hrs to fix

    Method minimumRedux has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function minimumRedux($modifiers)
        {
            if ($modifiers->isEmpty()) {
                return [];
            }
    Severity: Major
    Found in code/app/Models/Concerns/ReducibleTrait.php - About 2 hrs to fix

      Method run has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function run($request)
          {
              DB::beginTransaction();
      
              $direct_fields = ['name', 'weight', 'description', 'price', 'supplier_code', 'package_size', 'min_quantity', 'multiple', 'portion_quantity'];
      Severity: Major
      Found in code/app/Importers/CSV/Products.php - About 2 hrs to fix

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

        class Product extends Model
        {
            use HasFactory, SoftDeletes, ProductConcept, TracksUpdater, Priceable, ModifiableTrait, GASModel, SluggableID, Cachable;
        
            public $incrementing = false;
        Severity: Minor
        Found in code/app/Product.php - About 2 hrs to fix

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

          class BookedProduct extends Model
          {
              use HasFactory, GASModel, SluggableID, TracksUpdater, ModifiedTrait, LeafReducibleTrait, Cachable;
          
              public $incrementing = false;
          Severity: Minor
          Found in code/app/BookedProduct.php - About 2 hrs to fix

            Method importXML has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function importXML($xml, $replace, $supplier_id)
                {
                    if (is_null($replace)) {
                        $product = new Product();
                        $product->supplier_id = $supplier_id;
            Severity: Major
            Found in code/app/Importers/GDXP/Products.php - About 2 hrs to fix

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

                  public function handle()
                  {
                      $printer = new OrderPrinter();
                      $notifiable_users = [];
                      $all_files = [];
              Severity: Minor
              Found in code/app/Jobs/NotifyClosedOrder.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 handlingAttributes has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function handlingAttributes($booking, $modifier, $attribute)
                  {
                      /*
                          Se l'ordine è chiuso (ma non consegnato e archiviato) attingo dai
                          valori relativi, che includono sia il consegnato che il prenotato ma
              Severity: Minor
              Found in code/app/Singletons/ModifierEngine.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

              Utils has 23 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Utils {
                  static init(container)
                  {
                      $('.reloader', container).click(function(e) {
                          var listid = $(this).attr('data-reload-target');
              Severity: Minor
              Found in code/resources/assets/js/utils.js - About 2 hrs to fix

                Movement has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Movement extends Model
                {
                    use HasFactory, TracksUpdater, GASModel;
                
                    /*
                Severity: Minor
                Found in code/app/Movement.php - About 2 hrs to fix

                  Role has 23 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Role extends Model
                  {
                      use HasFactory, GASModel, Cachable;
                  
                      private $real_targets = null;
                  Severity: Minor
                  Found in code/app/Role.php - About 2 hrs to fix

                    Function tableFilters has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        static tableFilters(table_id)
                        {
                            var filters = $('[data-table-target="' + table_id + '"]');
                            var table = $('table' + table_id);
                            var elements = table.find('tbody tr');
                    Severity: Major
                    Found in code/resources/assets/js/filters.js - About 2 hrs to fix

                      Method importXML has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function importXML($xml, $replace)
                          {
                              if (is_null($replace)) {
                                  $supplier = new Supplier();
                                  $supplier->payment_method = '';
                      Severity: Major
                      Found in code/app/Importers/GDXP/Suppliers.php - About 2 hrs to fix

                        Method getValue has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getValue($type, $with_friends, $force_recalculate = false)
                            {
                                $key = sprintf('%s_%s', $type, $with_friends ? 'friends' : 'nofriends');
                        
                                if ($force_recalculate) {
                        Severity: Major
                        Found in code/app/Booking.php - About 2 hrs to fix

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

                              public function update($id, array $request)
                              {
                                  $modifier = $this->show($id);
                                  $this->testAccess($modifier);
                          
                          
                          Severity: Minor
                          Found in code/app/Services/ModifiersService.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 readGdxpFile has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function readGdxpFile($path, $execute, $supplier_replace)
                              {
                                  $working_dir = sys_get_temp_dir();
                          
                                  $data = [];
                          Severity: Minor
                          Found in code/app/Http/Controllers/ImportController.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 callables.js has 267 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          window.$ = window.jQuery = global.$ = global.jQuery = require('jquery');
                          require('bootstrap');
                          
                          import utils from "./utils";
                          import lists from "./lists";
                          Severity: Minor
                          Found in code/resources/assets/js/callables.js - About 2 hrs to fix

                            Function init has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                static init(container)
                                {
                                    $('.loadable-list', container).each(function() {
                                        Lists.testListsEmptiness($(this));
                                    });
                            Severity: Major
                            Found in code/resources/assets/js/lists.js - About 2 hrs to fix

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

                                  private function readBooking(array $request, $order, $booking, $delivering)
                                  {
                                      $param = $this->handlingParam($delivering);
                              
                                      if (isset($request['notes_' . $order->id])) {
                              Severity: Major
                              Found in code/app/Services/BookingsService.php - About 2 hrs to fix

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

                                function unrollPeriodic($value)
                                {
                                    if (!isset($value->from) || !isset($value->to)) {
                                        return [];
                                    }
                                Severity: Major
                                Found in code/app/Helpers/Dates.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language