madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Method columnsByFeatures has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function columnsByFeatures($ret)
    {
        $current_gas = currentAbsoluteGas();

        if ($current_gas->hasFeature('shipping_places')) {
Severity: Minor
Found in code/app/Formatters/User.php - About 1 hr to fix

    Method handle has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function handle(VariantChanged $event)
        {
            $product = $event->variant->product;
    
            /*
    Severity: Minor
    Found in code/app/Listeners/ReviewProductVariantCombos.php - About 1 hr to fix

      Function testAccess has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          private function testAccess($modifier)
          {
              switch($modifier->target_type) {
                  case 'App\Supplier':
                      $this->ensureAuth(['supplier.modify' => $modifier->target]);
      Severity: Minor
      Found in code/app/Services/ModifiersService.php - About 1 hr 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 postGdxp has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function postGdxp(Request $request)
          {
              // try {
                  $archivepath = '';
                  $working_dir = sys_get_temp_dir();
      Severity: Minor
      Found in code/app/Http/Controllers/ImportController.php - About 1 hr 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 iconsLegendTrigger has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          static iconsLegendTrigger(node, legend_class)
          {
              /*
                  Se clicco l'intestazione di un dropdown, passo oltre. Qui interviene
                  il JS di Bootstrap per aprire e chiudere il dropdown stesso
      Severity: Minor
      Found in code/resources/assets/js/filters.js - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handle()
          {
              $hub = app()->make('GlobalScopeHub');
              $gas = $hub->getGasObj();
      
      
      Severity: Minor
      Found in code/app/Jobs/NotifyRemindOrder.php - About 1 hr 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 postFixes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function postFixes(Request $request, $id)
          {
              DB::beginTransaction();
      
              $order = $this->service->show($id, true);
      Severity: Minor
      Found in code/app/Http/Controllers/OrdersController.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handle()
          {
              $suppliers = Supplier::whereNotNull('remote_lastimport')->get();
      
              if ($suppliers->isEmpty() == false) {
      Severity: Minor
      Found in code/app/Console/Commands/CheckRemoteProducts.php - About 1 hr 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 printableDate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      function printableDate($value, $short = false)
      {
          if (is_null($value) || empty($value)) {
              return _i('Mai');
          }
      Severity: Minor
      Found in code/app/Helpers/Dates.php - About 1 hr 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 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handle(VariantChanged $event)
          {
              $product = $event->variant->product;
      
              /*
      Severity: Minor
      Found in code/app/Listeners/ReviewProductVariantCombos.php - About 1 hr 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 testApplication has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          private function testApplication($obj, $cache_type)
          {
              $this->appliesCache();
      
              $class = get_class($obj);
      Severity: Minor
      Found in code/app/Role.php - About 1 hr 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 guessReplyTo has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function guessReplyTo($message, $from)
          {
              try {
                  $reply = null;
      
      
      Severity: Minor
      Found in code/app/Notifications/Concerns/MailReplyTo.php - About 1 hr 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 hasBrokenModifier has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function hasBrokenModifier()
          {
              if ($this->id == 'booking-payment') {
                  $types = Modifier::has('movementType')->pluck('movement_type_id')->unique();
                  $types = MovementType::whereIn('id', $types)->get();
      Severity: Minor
      Found in code/app/MovementType.php - About 1 hr 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 organizeForProducts has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function organizeForProducts(&$products_modifiers, $target_modifiers, $key): void
          {
              foreach($target_modifiers as $pmod) {
                  if ($pmod->target_type == BookedProduct::class) {
                      $mod_id = $pmod->modifier->modifier_type_id;
      Severity: Minor
      Found in code/app/ModifiedValue.php - About 1 hr 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 readVariants has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function readVariants($product, $booked, $values, $quantities, $delivering)
          {
              $param = $this->handlingParam($delivering);
              $quantity = 0;
              $saved_variants = [];
      Severity: Minor
      Found in code/app/Services/BookingsService.php - About 1 hr to fix

        Method updateOrders has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function updateOrders(array $request)
            {
                $user = $this->ensureAuth(['supplier.orders' => null]);
                $suppliers = array_keys($user->targetsByAction('supplier.orders'));
        
        
        Severity: Minor
        Found in code/app/Services/DatesService.php - About 1 hr to fix

          Function content has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      content: function() {
                          var ret = '<div>\
                              <div class="row mb-2"><label for="password" class="col-4 col-form-label">' + _('Nuova Password') + '</label><div class="col-8"><input type="password" class="form-control" name="password" value="" autocomplete="off" minlength="8"></div></div>\
                              <div class="row mb-2"><label for="password_confirm" class="col-4 col-form-label">' + _('Conferma Password') + '</label><div class="col-8"><input type="password" class="form-control" name="password_confirm" value="" autocomplete="off" minlength="8"></div></div>';
          
          
          Severity: Minor
          Found in code/resources/assets/js/password.js - About 1 hr to fix

            Method readGdxpFile has 35 lines of code (exceeds 25 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 1 hr to fix

              Method fastShipping has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function fastShipping($deliverer, $aggregate, $users = null)
                  {
                      DB::beginTransaction();
              
                      $service = app()->make('BookingsService');
              Severity: Minor
              Found in code/app/Services/FastBookingsService.php - About 1 hr to fix

                Method productByString has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function productByString($string, $products = null)
                {
                    if (is_null($products)) {
                        $products = App\Product::all();
                    }
                Severity: Minor
                Found in code/app/Helpers/Reflection.php - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language