madbob/GASdottoNG

View on GitHub

Showing 494 of 494 total issues

Function iban_split has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function iban_split($iban, $field)
{
    switch($field) {
        case 'country':
            $start = 0;
Severity: Minor
Found in code/app/Helpers/Formatters.php - About 45 mins 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 getCalendarStringAttribute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCalendarStringAttribute()
    {
        if($this->type == 'internal') {
            return $this->description;
        }
Severity: Minor
Found in code/app/Date.php - About 45 mins 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 getOrderDatesAttribute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOrderDatesAttribute()
    {
        $ret = [];

        if ($this->type != 'order') {
Severity: Minor
Found in code/app/Date.php - About 45 mins 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 saved has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function saved(Config $config)
    {
        switch($config->name) {
            case 'integralces':
                $value = json_decode($config->value);
Severity: Minor
Found in code/app/Observers/ConfigObserver.php - About 45 mins 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 detachProduct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function detachProduct($product)
    {
        $altered_bookings = 0;

        /*
Severity: Minor
Found in code/app/Order.php - About 45 mins 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 formatDateToComponent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function formatDateToComponent($component, $params)
{
    $mandatory = $params['required'];

    $defaults_now = $params['attributes']['defaults_now'] ?? false;
Severity: Minor
Found in code/app/Helpers/Components.php - About 45 mins 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 handleSave has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function handleSave($gas, $request)
    {
        $satispay_info = null;

        if ($request->has('enable_satispay')) {
Severity: Minor
Found in code/app/Parameters/Config/Satispay.php - About 45 mins 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 show has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function show(Request $request, $aggregate_id, $user_id)
    {
        $user = User::findOrFail($user_id);
        $aggregate = Aggregate::findOrFail($aggregate_id);

Severity: Minor
Found in code/app/Http/Controllers/BookingUserController.php - About 45 mins 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 createBookingQuery has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private function createBookingQuery($query, $type, $start, $end, $target, $supplier)
Severity: Minor
Found in code/app/Http/Controllers/StatisticsController.php - About 45 mins to fix

    Function initCollectionMacros has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private function initCollectionMacros()
        {
            /*
                Questa va usata solo per una Collection di BookedProductVariant,
                come ad esempio la relazione variants() di BookedProduct
    Severity: Minor
    Found in code/app/Providers/AppServiceProvider.php - About 45 mins 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 getAllDatesAttribute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getAllDatesAttribute()
        {
            if (empty($this->recurring)) {
                return [$this->date];
            }
    Severity: Minor
    Found in code/app/Date.php - About 45 mins 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 formatSummary has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function formatSummary($order, $document, $fields, $status, $shipping_place, $extra_modifiers)
    Severity: Minor
    Found in code/app/Printers/Concerns/Summary.php - About 45 mins to fix

      Function importJSON has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function importJSON($supplier, $json, $replace)
          {
              if (is_null($replace)) {
                  $product = new Product();
              }
      Severity: Minor
      Found in code/app/Importers/GDXP/Products.php - About 45 mins 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 transationRole has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function transationRole($obj_peer)
          {
              $ret = null;
      
              if ($this->sender_id == $obj_peer->id) {
      Severity: Minor
      Found in code/app/Movement.php - About 45 mins 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 addModifiers has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function addModifiers($order, $summary, $status, $total, $fields, $extra_modifiers)
      Severity: Minor
      Found in code/app/Printers/Concerns/Summary.php - About 45 mins to fix

        Function describingAttributesMerge has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function describingAttributesMerge($first, $second)
            {
                if (is_null($first)) {
                    return clone $second;
                }
        Severity: Minor
        Found in code/app/Models/Concerns/ReducibleTrait.php - About 45 mins 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 attachByRequest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function attachByRequest($request, $id = null)
            {
                $file = $request['file'] ?? null;
                $url = $request['url'] ?? null;
                $name = $request['name'] ?? '';
        Severity: Minor
        Found in code/app/Models/Concerns/AttachableTrait.php - About 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                                                if (isset($datarow['variant_selection_' . $variant_id]) == false) {
                                                    $datarow['variant_selection_' . $variant_id] = [];
                                                }
        Severity: Major
        Found in code/app/Importers/CSV/Deliveries.php - About 45 mins to fix

          Function apply has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function apply(Builder $builder, Model $model)
              {
                  $hub = App::make('GlobalScopeHub');
          
                  /*
          Severity: Minor
          Found in code/app/Scopes/RestrictedGAS.php - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                                              if (isset($datarow['variant_quantity_' . $product_id]) == false) {
                                                  $datarow['variant_quantity_' . $product_id] = [];
                                              }
          Severity: Major
          Found in code/app/Importers/CSV/Deliveries.php - About 45 mins to fix
            Severity
            Category
            Status
            Source
            Language