madbob/GASdottoNG

View on GitHub

Showing 441 of 501 total issues

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

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

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

    BookedProduct has 23 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

      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

        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

          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

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

                    public function postStatusSES(Request $request)
                    {
                        if (env('MAIL_MAILER') == 'ses') {
                            $message = Message::fromRawPostData();
                            $validator = new MessageValidator();
                Severity: Minor
                Found in code/app/Http/Controllers/MailController.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 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 systemInit has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function systemInit($mov)
                        {
                            $mov->callbacks = [
                                'pre' => function (Movement $movement) {
                                    /*
                    Severity: Major
                    Found in code/app/Parameters/MovementType/BookingPayment.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

                        File callables.js has 261 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 unrollSpecialSelectors has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function unrollSpecialSelectors($users)
                          {
                              $map = [];
                          
                              if (!is_array($users)) {
                          Severity: Minor
                          Found in code/app/Helpers/Reflection.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 run has a Cognitive Complexity of 17 (exceeds 5 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: Minor
                          Found in code/app/Importers/CSV/Products.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 handleSummary has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function handleSummary($obj, $request)
                              {
                                  $subtype = $request['format'] ?? 'pdf';
                          
                                  if ($subtype == 'gdxp') {
                          Severity: Minor
                          Found in code/app/Printers/Aggregate.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

                          Severity
                          Category
                          Status
                          Source
                          Language