madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Function getConvenientStringsAttribute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getConvenientStringsAttribute()
    {
        $suppliers = [];
        $shipping_date = PHP_INT_MAX;

Severity: Minor
Found in code/app/AggregateBooking.php - About 1 hr 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 comparePrices has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function comparePrices($other)
    {
        if ($this->getPrice(false) != $other->getPrice(false)) {
            return false;
        }
Severity: Minor
Found in code/app/Product.php - About 1 hr 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 selective has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function selective()
    {
        if (currentAbsoluteGas()->hasFeature('shipping_places')) {
            return [
                'truck' => (object) [
Severity: Minor
Found in code/app/View/Icons/AggregateBooking.php - About 1 hr 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 dispatchToSupplier has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function dispatchToSupplier($order)
    {
        if ($order->isRunning() == false) {
            $supplier = $order->supplier;

Severity: Minor
Found in code/app/Jobs/NotifyClosedOrder.php - About 1 hr 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 dynamicModifiers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function dynamicModifiers(array $request, $aggregate, $target_user)
    {
        /*
            Innanzitutto, qui sospendo l'esecuzione delle callback sui movimenti
            contabili. Nella fase di revisione della prenotazione capita che i
Severity: Minor
Found in code/app/Services/DynamicBookingsService.php - About 1 hr 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 postStatusScaleway has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function postStatusScaleway(Request $request)
    {
        if (env('MAIL_MAILER') == 'scaleway') {
            $api_endpoint = 'https://api.scaleway.com/transactional-email/v1alpha1/regions/fr-par/webhooks';

Severity: Minor
Found in code/app/Http/Controllers/MailController.php - About 1 hr 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 saving has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function saving(Movement $movement)
    {
        if ($this->movements_hub->isSuspended()) {
            return true;
        }
Severity: Minor
Found in code/app/Observers/MovementObserver.php - About 1 hr 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 unalignedModifiers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function unalignedModifiers($master_summary)
    {
        if ($this->isActive()) {
            return [];
        }
Severity: Minor
Found in code/app/Order.php - About 1 hr 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 applyModifiers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function applyModifiers($aggregate_data = null, $enforce_status = false)
    {
        $modifiers = new Collection();
        $order_modifiers = $this->involvedModifiers(true);

Severity: Minor
Found in code/app/Order.php - About 1 hr 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 roleByFunction has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function roleByFunction($identifier)
{
    $gas = currentAbsoluteGas();
    $role_id = $gas->roles[$identifier] ?? null;
    $ret = App\Role::find($role_id);
Severity: Minor
Found in code/app/Helpers/Permissions.php - About 1 hr 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 readProductQuantity has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function readProductQuantity($product, $field, $friends_bookings)
    {
        $combo = null;

        if (is_a($product, VariantCombo::class)) {
Severity: Minor
Found in code/app/Booking.php - About 1 hr 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 retrievePreSelectedFields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function retrievePreSelectedFields($parameters)
    {
        $selected = [];

        if (isset($parameters['sorted_fields']) && empty($parameters['sorted_fields']) == false) {
Severity: Minor
Found in code/app/Importers/CSV/CSVImporter.php - About 1 hr 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 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static init(container)
    {
        /*
            Questo mostra/nasconde il trigger addizionale per modificare in
            blocco l'ordinabilità dei prodotti, nella griglia della modifica
Severity: Minor
Found in code/resources/assets/js/products.js - About 1 hr to fix

    Method ensureAuth has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function ensureAuth($permissions = [], $or = true)
        {
            $user = Auth::user();
    
            if (is_null($user)) {
    Severity: Minor
    Found in code/app/Services/BaseService.php - About 1 hr to fix

      Method sumUpProducts has 31 lines of code (exceeds 25 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 1 hr to fix

        Method create has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function create(Request $request)
            {
                $type = $request->input('type', null);
                if (is_null($type)) {
                    return view('movement.create');
        Severity: Minor
        Found in code/app/Http/Controllers/MovementsController.php - About 1 hr to fix

          Method postStatusScaleway has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function postStatusScaleway(Request $request)
              {
                  if (env('MAIL_MAILER') == 'scaleway') {
                      $api_endpoint = 'https://api.scaleway.com/transactional-email/v1alpha1/regions/fr-par/webhooks';
          
          
          Severity: Minor
          Found in code/app/Http/Controllers/MailController.php - About 1 hr to fix

            Method movementTypes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function movementTypes($identifier = null, $with_trashed = false)
            {
                static $types = null;
            
                if ($identifier == 'VOID') {
            Severity: Minor
            Found in code/app/Helpers/Accounting.php - About 1 hr to fix

              Method fields has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function fields()
                  {
                      $ret = [
                          'date' => (object) [
                              'label' => _i('Data'),
              Severity: Minor
              Found in code/app/Importers/CSV/Movements.php - About 1 hr to fix

                Method up has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function up()
                    {
                        /*
                            Questa migrazione serve solo per il profiler, va adoperata per lo
                            sviluppo locale e non serve eseguirla sulle istanze di produzione
                Severity: Minor
                Found in code/database/migrations/2023_08_14_231825_create_xhprof_table.php - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language