madbob/GASdottoNG

View on GitHub

Showing 494 of 494 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (test.length != 0) {
            var list = $('#' + test.val());
            Lists.appendToLoadableList(list, data, true);
        }
Severity: Minor
Found in code/resources/assets/js/lists.js and 1 other location - About 45 mins to fix
code/resources/assets/js/lists.js on lines 110..113

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (test.length != 0) {
            var list = $('#' + test.val());
            Lists.appendToLoadableList(list, data, false);
        }
Severity: Minor
Found in code/resources/assets/js/lists.js and 1 other location - About 45 mins to fix
code/resources/assets/js/lists.js on lines 104..107

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        $('input[data-alternative-required]', container).change((e) => {
            this.reviewRequired($(e.currentTarget).closest('form'));
        });
Severity: Minor
Found in code/resources/assets/js/utils.js and 1 other location - About 40 mins to fix
code/resources/assets/js/filters.js on lines 20..22

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        $('.table-text-filter', container).keyup((e) => {
            this.tableFilters($(e.currentTarget).attr('data-table-target'));
        });
Severity: Minor
Found in code/resources/assets/js/filters.js and 1 other location - About 40 mins to fix
code/resources/assets/js/utils.js on lines 55..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    static supplierAttachUser(list, user_id) {
        var supplier_id = list.attr('data-supplier-id');
        var role_id = list.attr('data-role-id');
        Callables.attachUserRole(role_id, user_id, supplier_id, 'App\\Supplier');
    }
Severity: Minor
Found in code/resources/assets/js/callables.js and 1 other location - About 40 mins to fix
code/resources/assets/js/callables.js on lines 40..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    static supplierDetachUser(list, user_id) {
        var supplier_id = list.attr('data-supplier-id');
        var role_id = list.attr('data-role-id');
        Callables.detachUserRole(role_id, user_id, supplier_id, 'App\\Supplier');
    }
Severity: Minor
Found in code/resources/assets/js/callables.js and 1 other location - About 40 mins to fix
code/resources/assets/js/callables.js on lines 34..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method applyDefinition has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private function applyDefinition($booking, $modifier, $amount, $definition, $target)
Severity: Minor
Found in code/app/Singletons/ModifierEngine.php - About 35 mins to fix

    Method readVariants has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private function readVariants($product, $booked, $values, $quantities, $delivering)
    Severity: Minor
    Found in code/app/Services/BookingsService.php - About 35 mins to fix

      Method handleBookingUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function handleBookingUpdate($request, $user, $order, $target_user, $delivering)
      Severity: Minor
      Found in code/app/Services/BookingsService.php - About 35 mins to fix

        Method output_csv has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function output_csv($filename, $head, $contents, $format_callback, $out_file = null)
        Severity: Minor
        Found in code/app/Helpers/Formatters.php - About 35 mins to fix

          Method getSupplier has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Method formatSummaryShipping has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Method mapSelection has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  private function mapSelection($objects, $param, $value, $field, &$product)
              Severity: Minor
              Found in code/app/Importers/CSV/Products.php - About 35 mins to fix

                Method formatTableRows has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private function formatTableRows($aggregate, $shipping_place, $status, $fields, &$all_products)
                Severity: Minor
                Found in code/app/Printers/Aggregate.php - About 35 mins to fix

                  Method formatShipping has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function formatShipping($order, $fields, $status, $shipping_place, $extra_modifiers)
                  Severity: Minor
                  Found in code/app/Printers/Concerns/Shipping.php - About 35 mins to fix

                    Method formatTableRows has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        private function formatTableRows($order, $shipping_place, $status, $fields, &$all_products)
                    Severity: Minor
                    Found in code/app/Printers/Order.php - About 35 mins to fix

                      Method formatProduct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          private function formatProduct($fields, $formattable, $product_redux, $product, $internal_offsets)
                      Severity: Minor
                      Found in code/app/Printers/Concerns/Orders.php - About 35 mins to fix

                        Function generalInit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function generalInit(container) {
                            if (container == null) {
                                container = $('body');
                            }
                        
                        
                        Severity: Minor
                        Found in code/resources/assets/js/gasdotto.js - About 35 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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function get($locale)
                            {
                                $ret = null;
                        
                                switch($locale) {
                        Severity: Minor
                        Found in code/app/View/Texts/Days.php - About 35 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 checkAccessToRole has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function checkAccessToRole($role_id)
                            {
                                $user = Auth::user();
                        
                                $managed_roles = $user->managed_roles->search(function($item, $key) use ($role_id) {
                        Severity: Minor
                        Found in code/app/Services/RolesService.php - About 35 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

                        Severity
                        Category
                        Status
                        Source
                        Language