madbob/GASdottoNG

View on GitHub

Showing 494 of 494 total issues

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

    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 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

    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

    File ModifierEngine.php has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace App\Singletons;
    
    use Illuminate\Support\Facades\Log;
    Severity: Minor
    Found in code/app/Singletons/ModifierEngine.php - About 2 hrs to fix

      Function iconsLegendTrigger has 55 lines of code (exceeds 25 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: Major
      Found in code/resources/assets/js/filters.js - About 2 hrs to fix

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

            protected function handleShipping($obj, $request)
            {
                $action = $request['action'] ?? 'download';
                $subtype = $request['format'] ?? 'pdf';
                $status = $request['status'] ?? 'pending';
        Severity: Major
        Found in code/app/Printers/Order.php - About 2 hrs to fix

          File Products.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace App\Importers\CSV;
          
          use DB;
          Severity: Minor
          Found in code/app/Importers/CSV/Products.php - About 2 hrs to fix

            File summary.blade.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            $summary = $master_summary->orders[$order->id];
            
            $columns = $currentgas->orders_display_columns;
            Severity: Minor
            Found in code/resources/views/order/summary.blade.php - About 2 hrs to fix

              Method handleSummary has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function handleSummary($obj, $request)
                  {
                      $action = $request['action'] ?? 'download';
                      $subtype = $request['format'] ?? 'pdf';
                      $extra_modifiers = $request['extra_modifiers'] ?? 0;
              Severity: Major
              Found in code/app/Printers/Order.php - About 2 hrs to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                else {
                                    let min = parseInt(i.val()) + 1;
                                    peer.attr('min', min);
                                    peer.removeAttr('max');
                
                
                Severity: Major
                Found in code/resources/assets/js/orders.js and 1 other location - About 2 hrs to fix
                code/resources/assets/js/orders.js on lines 21..29

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 77.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                if (action == 'ship') {
                                    let max = parseInt(i.val()) - 1;
                                    peer.attr('max', max);
                                    peer.removeAttr('min');
                
                
                Severity: Major
                Found in code/resources/assets/js/orders.js and 1 other location - About 2 hrs to fix
                code/resources/assets/js/orders.js on lines 30..38

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 77.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Function targetDefinition has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function targetDefinition($modifier, $value)
                    {
                        if ($modifier->scale == 'minor') {
                            foreach($modifier->definitions as $def) {
                                if ($value < $def->threshold) {
                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 getBookingsAttribute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getBookingsAttribute()
                    {
                        $ret = [];
                
                        foreach ($this->orders as $order) {
                Severity: Minor
                Found in code/app/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

                File widgets.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require('bootstrap-datepicker');
                require('select2');
                
                import utils from "./utils";
                
                
                Severity: Minor
                Found in code/resources/assets/js/widgets.js - About 2 hrs to fix

                  Function updateBookingQuantities has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      static updateBookingQuantities(dynamic_data, container, action)
                      {
                          for (let [product_id, product_meta] of Object.entries(dynamic_data)) {
                              var inputbox = $('input[name="' + product_id + '"]', container);
                              inputbox.closest('tr').find('.booking-product-price span').text(utils.priceRound(product_meta.total));
                  Severity: Major
                  Found in code/resources/assets/js/bookings.js - About 2 hrs to fix

                    File UsersController.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace App\Http\Controllers;
                    
                    use Illuminate\Http\Request;
                    Severity: Minor
                    Found in code/app/Http/Controllers/UsersController.php - About 2 hrs to fix

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

                          public static function formattableColumns($type = null)
                          {
                              $ret = [
                                  'name' => (object) [
                                      'name' => _i('Nome Prodotto'),
                      Severity: Minor
                      Found in code/app/Formatters/Order.php - About 2 hrs to fix

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                                $type->function = json_encode($this->voidFunctions([
                                    (object) [
                                        'method' => 'cash',
                                        'target' => $this->format(['bank' => 'increment']),
                                        'master' => $this->format(['cash' => 'increment']),
                        Severity: Major
                        Found in code/app/Parameters/MovementType/BookingPayment.php and 2 other locations - About 2 hrs to fix
                        code/app/Parameters/MovementType/OrderPayment.php on lines 22..34
                        code/app/Parameters/MovementType/UserDecredit.php on lines 18..30

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 121.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                                $type->function = json_encode($this->voidFunctions([
                                    (object) [
                                        'method' => 'cash',
                                        'target' => $this->format(['bank' => 'decrement']),
                                        'sender' => $this->format(['cash' => 'decrement']),
                        Severity: Major
                        Found in code/app/Parameters/MovementType/OrderPayment.php and 2 other locations - About 2 hrs to fix
                        code/app/Parameters/MovementType/BookingPayment.php on lines 25..37
                        code/app/Parameters/MovementType/UserDecredit.php on lines 18..30

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 121.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language