madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

Method saving has 28 lines of code (exceeds 25 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

    Method update has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function update(Request $request, $id)
        {
            DB::beginTransaction();
    
            $user = Auth::user();
    Severity: Minor
    Found in code/app/Http/Controllers/MeasuresController.php - About 1 hr to fix

      Method retrievePreSelectedFields has 28 lines of code (exceeds 25 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

        Function applyDefinition has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function applyDefinition($booking, $modifier, $amount, $definition, $target)
            {
                list($quantity_attribute, $price_attribute, $weight_attribute) = $this->applicationOffsets($booking);
                $reference_quantity = 1;
        
        
        Severity: Minor
        Found in code/app/Singletons/ModifierEngine.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 hasWarningWithinOrder has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function hasWarningWithinOrder($summary)
            {
                if (isset($summary->products[$this->id])) {
                    $quantity = $summary->products[$this->id]->quantity;
        
        
        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 postFeedback has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function postFeedback(Request $request, $id)
            {
                $ret = [];
        
                if ($id == 'booking-payment') {
        Severity: Minor
        Found in code/app/Http/Controllers/MovementTypesController.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 index has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function index(Request $request)
            {
                try {
                    $data['movements'] = $this->service->list($request->all());
                    $ret = null;
        Severity: Minor
        Found in code/app/Http/Controllers/MovementsController.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 getBooked has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getBooked($product_id, $fallback = false)
            {
                if (is_object($product_id)) {
                    $product = $product_id;
                    $product_id = $product_id->id;
        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 duplicateAllCurrentBalances has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function duplicateAllCurrentBalances($latest_date)
        {
            $current_status = [];
            $currencies = \App\Currency::enabled();
        
        
        Severity: Minor
        Found in code/app/Helpers/Accounting.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 fillParameters has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function fillParameters($gas, $params)
            {
                $params['gas_name'] = $gas->name;
        
                foreach(array_keys($this->params()) as $identifier) {
        Severity: Minor
        Found in code/app/Parameters/MailTypes/MailType.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 notify has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function notify($supplier, $e)
            {
                $body = _i('Nuovo aggiornamento disponibile per il listino %s (%s). Consultalo dal pannello Fornitori -> Indice Remoto.', [$supplier->printableName(), printableDate($e->lastchange)]);
                if (Notification::where('content', $body)->first() == null) {
                    $gas = Gas::all();
        Severity: Minor
        Found in code/app/Console/Commands/CheckRemoteProducts.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 defaultOrders has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function defaultOrders($mine)
        {
            if ($mine) {
                $user = Auth::user();
        
        
        Severity: Minor
        Found in code/app/Helpers/Orders.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 getSummary has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getSummary($start, $end, $type, $target)
            {
                if ($type == 'all') {
                    $data = $this->basicSummaryForAll($start, $end, $target);
                }
        Severity: Minor
        Found in code/app/Http/Controllers/StatisticsController.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 applications has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function applications($all = false, $exclude_trashed = false, $target_class = null)
            {
                $this->appliesCache();
        
                if ($all) {
        Severity: Minor
        Found in code/app/Role.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 guessByOrder has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function guessByOrder($order)
            {
                $contacts = $order->showableContacts();
                if ($contacts->isEmpty()) {
                    $roles = Role::havingAction('supplier.orders');
        Severity: Minor
        Found in code/app/Notifications/Concerns/MailReplyTo.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 apply has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function apply($movement)
            {
                $o = $this->opsByMethod($movement->method);
        
                if ($o) {
        Severity: Minor
        Found in code/app/MovementType.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 iconsLegend has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function iconsLegend($contents = null)
            {
                $ret = [];
        
                $box = self::myIconsBox();
        Severity: Minor
        Found in code/app/Models/Concerns/Iconable.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 formatSummaryShipping has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function formatSummaryShipping($order, $fields, $status, $shipping_place, $extra_modifiers)
            {
                $rows = [];
                $total = 0;
                $formattable = OrderFormatter::formattableColumns('summary');
        Severity: Minor
        Found in code/app/Printers/Concerns/Summary.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 formatSummary has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function formatSummary($order, $document, $fields, $status, $shipping_place, $extra_modifiers)
            {
                if ($shipping_place && $shipping_place == 'all_by_place') {
                    $places = Delivery::orderBy('name', 'asc')->get();
                    foreach($places as $place) {
        Severity: Minor
        Found in code/app/Printers/Concerns/Summary.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 getContactsByType has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getContactsByType($type)
            {
                $ret = [];
        
                if (is_array($type) == false) {
        Severity: Minor
        Found in code/app/Models/Concerns/ContactableTrait.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

        Severity
        Category
        Status
        Source
        Language