madbob/GASdottoNG

View on GitHub

Showing 495 of 495 total issues

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

    static init(container)
    {
        if (container.hasClass('modifier-modal')) {
            container.find('form').addClass('form-disabled');

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

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

        private function sumUpProducts($booking, &$datarow)
        {
            /*
                TODO: Nel caso di prenotazioni salvate sarebbe molto più efficiente
                cambiare semplicemente lo stato della prenotazione stessa, giacché
    Severity: Minor
    Found in code/app/Services/FastBookingsService.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 list has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function list($request)
        {
            /*
                TODO sarebbe assai più efficiente usare with('sender') e
                with('target'), ma poi la relazione in Movement si spacca (cambiando
    Severity: Minor
    Found in code/app/Services/MovementsService.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 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

            File edit.blade.php has 303 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

              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

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

                    class UsersController extends BackedController
                    {
                        public function __construct(UsersService $service)
                        {
                            $this->middleware('auth');
                    Severity: Minor
                    Found in code/app/Http/Controllers/UsersController.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
                          Severity
                          Category
                          Status
                          Source
                          Language