madbob/GASdottoNG

View on GitHub

Showing 437 of 497 total issues

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

    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

      Method select has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function select($request)
          {
              list($reader, $columns) = $this->initRead($request);
              list($name_index, $supplier_code_index) = $this->getColumnsIndex($columns, ['name', 'supplier_code']);
              $s = $this->getSupplier($request);
      Severity: Major
      Found in code/app/Importers/CSV/Products.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 handleShipping has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function handleShipping($obj, $request)
              {
                  $send_mail = isset($request['send_mail']);
                  $subtype = $request['format'] ?? 'pdf';
                  $status = $request['status'] ?? 'pending';
          Severity: Minor
          Found in code/app/Printers/Order.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 MovementsService.php has 300 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

              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

                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

                      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

                        Callables has 26 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

                          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

                            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