madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Function handlePreProcess has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    protected function handlePreProcess($request, $booking)
    {
        $manual_total = $this->deliveringManualTotal($request, $booking->order);
        if ($manual_total > 0) {
            $booking->enforceTotal($manual_total);
Severity: Minor
Found in code/app/Services/BookingsService.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 descriptions has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public static function descriptions($target)
    {
        /*
            Qui predispongo le stringhe descrittive per tutte le possibili
            combinazioni di valori, destinate a rendere più comprensibile la
Severity: Minor
Found in code/app/View/Texts/Modifier.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 postFeedback has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function postFeedback(Request $request, $id)
    {
        $ret = [];
        $aggregate = Aggregate::findOrFail($id);
        $master_summary = null;
Severity: Minor
Found in code/app/Http/Controllers/AggregatesController.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 compareBalances has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public static function compareBalances($old_balances)
    {
        $diff = [];

        foreach($old_balances as $currency_id => $data) {
Severity: Minor
Found in code/app/Models/Concerns/CreditableTrait.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

Method startTour has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function startTour(Request $request)
    {
        $user = $request->user();
        $gas = $user->gas;

Severity: Major
Found in code/app/Http/Controllers/TourController.php - About 2 hrs to fix

    Function setupPermissionsEditor has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static setupPermissionsEditor(container) {
            $('.roleAssign', container).each(function() {
                if ($(this).hasClass('tt-hint') == true) {
                    return;
                }
    Severity: Major
    Found in code/resources/assets/js/roles.js - About 2 hrs to fix

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

      class UsersController extends BackedController
      {
          public function __construct(UsersService $service)
          {
              $this->commonInit([
      Severity: Minor
      Found in code/app/Http/Controllers/UsersController.php - About 2 hrs to fix

        File BookedProduct.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          Method list has 69 lines of code (exceeds 25 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: Major
          Found in code/app/Services/MovementsService.php - About 2 hrs to fix

            Function parseRules has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                private function parseRules(&$data, $role, $classname, $request)
                {
                    $payments = paymentTypes();
                    $valid_payments = array_intersect_key($request, $payments);
                    $fields = (new $classname())->balanceFields();
            Severity: Minor
            Found in code/app/Services/MovementTypesService.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 registerPolicies has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                public function registerPolicies()
                {
                    $all_permissions = allPermissions();
            
                    foreach ($all_permissions as $rules) {
            Severity: Minor
            Found in code/app/Services/RolesService.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 readVariants has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                private function readVariants($product, $booked, $values, $quantities, $delivering)
                {
                    $param = $this->handlingParam($delivering);
                    $quantity = 0;
                    $saved_variants = [];
            Severity: Minor
            Found in code/app/Services/BookingsService.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 update has a Cognitive Complexity of 20 (exceeds 5 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 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 productByString has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            function productByString($string, $products = null)
            {
                if (is_null($products)) {
                    $products = App\Product::all();
                }
            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 handle has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                public function handle()
                {
                    $orders = Order::where('status', 'open')->where('end', '>', Carbon::today()->format('Y-m-d'))->get();
                    $notifications = [];
            
            
            Severity: Minor
            Found in code/app/Console/Commands/RemindOrders.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 hasChangedProdcts has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                public function hasChangedProdcts()
                {
                    $has_changed_products = false;
            
                    if ($this->isActive()) {
            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 UsersService.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Method minimumRedux has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function minimumRedux($modifiers)
                  {
                      if ($modifiers->isEmpty()) {
                          return [];
                      }
              Severity: Major
              Found in code/app/Models/Concerns/ReducibleTrait.php - About 2 hrs to fix

                Method run has 67 lines of code (exceeds 25 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: Major
                Found in code/app/Importers/CSV/Products.php - About 2 hrs to fix

                  Product has 24 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Product extends Model
                  {
                      use HasFactory, SoftDeletes, ProductConcept, TracksUpdater, Priceable, ModifiableTrait, GASModel, SluggableID, Cachable;
                  
                      public $incrementing = false;
                  Severity: Minor
                  Found in code/app/Product.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language