madbob/GASdottoNG

View on GitHub

Showing 494 of 494 total issues

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

Function select has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                select: function(event, ui) {
                    var aggregate_id = input.attr('data-aggregate');
                    var while_shipping = (input.closest('.modal.add-booking-while-shipping').length != 0);
                    var fill_target = input.closest('.fillable-booking-space').find('.other-booking');
                    fill_target.empty().append(utils.j().makeSpinner());
Severity: Minor
Found in code/resources/assets/js/bookings.js - About 1 hr to fix

    Method testAccess has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function testAccess($modifier)
        {
            switch($modifier->target_type) {
                case 'App\Supplier':
                    $this->ensureAuth(['supplier.modify' => $modifier->target]);
    Severity: Minor
    Found in code/app/Services/ModifiersService.php - About 1 hr to fix

      Method getHistoryDetails has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getHistoryDetails(Request $request)
          {
              $this->checkAuth();
              $date = $request->input('date');
      
      
      Severity: Minor
      Found in code/app/Http/Controllers/MovementsController.php - About 1 hr to fix

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

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

            Method exportIntegralCES has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function exportIntegralCES($gas, $objects, $filename, $body)
                {
                    $currency = Currency::where('context', 'integralces')->first();
            
                    return output_csv($filename, null, $objects, function($object) use ($gas, $currency, $body) {
            Severity: Minor
            Found in code/app/Http/Controllers/MovementsController.php - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language