madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Method serializeTransformations has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function serializeTransformations($target, $json_target)
    {
        $transformations = [];
        $modifiers = $target->modifiers->filter(fn($m) => $m->active && in_array($m->modifierType->identifier, ['shipping', 'discount']));

Severity: Minor
Found in code/resources/views/gdxp/json/supplier.blade.php - About 1 hr to fix

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

        public function handle()
        {
            $this->doAlways();
    
            /*
    Severity: Minor
    Found in code/app/Console/Commands/FixDatabase.php - About 1 hr to fix

      Method importJSON has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function importJSON($supplier, $json, $replace)
          {
              if (is_null($replace)) {
                  $product = new Product();
              }
      Severity: Minor
      Found in code/app/Importers/GDXP/Products.php - About 1 hr to fix

        Method fields has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function fields()
            {
                return [
                    'name' => (object) [
                        'label' => _i('Nome'),
        Severity: Minor
        Found in code/app/Importers/CSV/Products.php - About 1 hr to fix

          Method update has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function update($id, array $request)
              {
                  if ($id == 0) {
                      $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

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

                public function handle()
                {
                    $printer = new OrderPrinter();
                    $notifiable_users = [];
                    $all_files = [];
            Severity: Minor
            Found in code/app/Jobs/NotifyClosedOrder.php - About 1 hr to fix

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

                Method orders has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function orders()
                    {
                        static $ret = null;
                
                        if (is_null($ret)) {
                Severity: Minor
                Found in code/app/Helpers/Status.php - About 1 hr to fix

                  Function ensureAuth has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function ensureAuth($permissions = [], $or = true)
                      {
                          $user = Auth::user();
                  
                          if (is_null($user)) {
                  Severity: Minor
                  Found in code/app/Services/BaseService.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 store has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function store(Request $request)
                      {
                          DB::beginTransaction();
                  
                          $data = $request->input('data');
                  Severity: Minor
                  Found in code/app/Http/Controllers/AggregatesController.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 show has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function show(Request $request, $id)
                      {
                          $user = Auth::user();
                  
                          $format = $request->input('format', 'html');
                  Severity: Minor
                  Found in code/app/Http/Controllers/ProductsController.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 calculateModifiers has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function calculateModifiers($aggregate_data = null, $real = true)
                      {
                          $values = new Collection();
                  
                          $modifiers = $this->involvedModifiers();
                  Severity: Minor
                  Found in code/app/Booking.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 getSupplier has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function getSupplier($start, $end, $type, $target, $supplier)
                      {
                          $data = [];
                          $categories = [];
                  
                  
                  Severity: Minor
                  Found in code/app/Http/Controllers/StatisticsController.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 updateRecursive has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function updateRecursive($data, $parent, &$accumulator)
                      {
                          foreach ($data as $category) {
                              $c = null;
                  
                  
                  Severity: Minor
                  Found in code/app/Http/Controllers/CategoriesController.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 appliesCache has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function appliesCache()
                      {
                          if (is_null($this->applies_cache)) {
                              $applies_cache = [];
                              $applies_only_cache = [];
                  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

                  Method doPayment has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function doPayment(Request $request)
                      {
                          $type = $request->input('type');
                  
                          if ($type == 'satispay') {
                  Severity: Minor
                  Found in code/app/Http/Controllers/PaymentController.php - About 1 hr to fix

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

                        public function run($request)
                        {
                            $imports = $request->input('import', []);
                            $dates = $request->input('date', []);
                            $senders = $request->input('sender_id', []);
                    Severity: Minor
                    Found in code/app/Importers/CSV/Movements.php - About 1 hr to fix

                      Method calculateInvoicingSummary has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function calculateInvoicingSummary()
                          {
                              $summary = (object) [
                                  'order' => $this->id,
                                  'total' => 0,
                      Severity: Minor
                      Found in code/app/Order.php - About 1 hr to fix

                        Function movementTypeEditor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            static movementTypeEditor(container)
                            {
                                $('select[name=sender_type], select[name=target_type]', container).change(function(e) {
                                    var editor = $(this).closest('.movement-type-editor');
                                    var sender = editor.find('select[name=sender_type] option:selected').val();
                        Severity: Minor
                        Found in code/resources/assets/js/movements.js - About 1 hr to fix

                          Method formattableColumns has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function formattableColumns($type = null)
                              {
                                  $ret = [
                                      'lastname' => (object) [
                                          'name' => _i('Cognome'),
                          Severity: Minor
                          Found in code/app/Formatters/User.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language