madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Function document has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function document(Request $request, $type, $subtype = 'none')
    {
        $user = $this->checkAuth();

        switch ($type) {
Severity: Minor
Found in code/app/Http/Controllers/MovementsController.php - About 3 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 computeStrings has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function computeStrings()
    {
        $names = [];
        $dates = [];

Severity: Minor
Found in code/app/Aggregate.php - About 3 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 utils.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require('continous-calendar');

import jBob from "jbob";
import Lists from "./lists";

Severity: Minor
Found in code/resources/assets/js/utils.js - About 3 hrs to fix

    File MovementsService.php has 306 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace App\Services;
    
    use App\Exceptions\IllegalArgumentException;
    Severity: Minor
    Found in code/app/Services/MovementsService.php - About 3 hrs to fix

      Aggregate has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Aggregate extends Model
      {
          use HasFactory, GASModel, ModifiableTrait, ReducibleTrait, WithinGas;
      
          protected $dispatchesEvents = [
      Severity: Minor
      Found in code/app/Aggregate.php - About 3 hrs to fix

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

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

          Function updateAccessType has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              private function updateAccessType($id, $request)
              {
                  $user = Auth::user();
                  if (is_null($user)) {
                      throw new AuthException(401);
          Severity: Minor
          Found in code/app/Services/UsersService.php - About 3 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 81 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static init(container)
              {
                  $('.icons-legend button, .icons-legend a', container).click((e) => {
                      e.preventDefault();
                      this.iconsLegendTrigger($(e.currentTarget), '.icons-legend');
          Severity: Major
          Found in code/resources/assets/js/filters.js - About 3 hrs to fix

            File Role.php has 299 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace App;
            
            use Illuminate\Database\Eloquent\Model;
            Severity: Minor
            Found in code/app/Role.php - About 3 hrs to fix

              Callables has 27 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Callables {
                  static attachUserRole(role_id, user_id, target_id, target_class) {
                      utils.postAjax({
                          method: 'POST',
                          url: 'roles/attach',
              Severity: Minor
              Found in code/resources/assets/js/callables.js - About 3 hrs to fix

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

                <?php
                
                $more_orders = ($aggregate->orders->count() > 1);
                $handling_movements = someoneCan('movements.admin', $currentgas);
                $tot_amount = 0;
                Severity: Minor
                Found in code/resources/views/delivery/edit.blade.php - About 3 hrs to fix

                  Method displayColumns has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function displayColumns()
                      {
                          $ret = [
                              'selection' => (object) [
                                  'label' => _i('Selezione'),
                  Severity: Major
                  Found in code/app/Order.php - About 3 hrs to fix

                    Function systemInit has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function systemInit($mov)
                        {
                            $mov->callbacks = [
                                'pre' => function (Movement $movement) {
                                    /*
                    Severity: Minor
                    Found in code/app/Parameters/MovementType/BookingPayment.php - About 3 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 paymentsByType has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function paymentsByType($type)
                    {
                        $ret = [];
                    
                        if ($type != null) {
                    Severity: Minor
                    Found in code/app/Helpers/Accounting.php - About 3 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 minimumRedux has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function minimumRedux($modifiers)
                        {
                            if ($modifiers->isEmpty()) {
                                return [];
                            }
                    Severity: Minor
                    Found in code/app/Models/Concerns/ReducibleTrait.php - About 3 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 Product.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace App;
                    
                    use Illuminate\Database\Eloquent\Model;
                    Severity: Minor
                    Found in code/app/Product.php - About 3 hrs to fix

                      File BookingsService.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace App\Services;
                      
                      use Illuminate\Support\Collection;
                      Severity: Minor
                      Found in code/app/Services/BookingsService.php - About 3 hrs to fix

                        Function aggregator has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            $.fn.aggregator = function() {
                                $(this).each(function() {
                                    $(this).find('div.card').each(function() {
                                        initAggregatorList($(this));
                                    });
                        Severity: Major
                        Found in code/resources/assets/js/aggregation.js - About 2 hrs to fix

                          Function generalInit has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function generalInit(container) {
                              if (container == null) {
                                  container = $('body');
                              }
                          
                          
                          Severity: Major
                          Found in code/resources/assets/js/gasdotto.js - About 2 hrs to fix

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

                                protected function handleShipping($obj, $request)
                                {
                                    $subtype = $request['format'] ?? 'pdf';
                                    $required_fields = $request['fields'] ?? [];
                            
                            
                            Severity: Major
                            Found in code/app/Printers/Aggregate.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language