madbob/GASdottoNG

View on GitHub

Showing 497 of 497 total issues

Function send has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function send($elements): void
    {
        foreach($elements as $receipt) {
            if ($receipt->mailed == false) {
                try {
Severity: Minor
Found in code/app/Http/Controllers/ReceiptsController.php - About 25 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 decodePeriodic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function decodePeriodic($value)
{
    if (empty($value))
        return '';

Severity: Minor
Found in code/app/Helpers/Dates.php - About 25 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 unalignedPrices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function unalignedPrices($product)
    {
        $to_change = [];
        $orders = $product->supplier->active_orders;

Severity: Minor
Found in code/app/Http/Controllers/ProductsController.php - About 25 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 formatObjectsToComponentRec has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function formatObjectsToComponentRec($options)
{
    $ret = [];

    foreach($options as $option) {
Severity: Minor
Found in code/app/Helpers/Components.php - About 25 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 columnsByFeatures has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function columnsByFeatures($ret)
    {
        $current_gas = currentAbsoluteGas();

        if ($current_gas->hasFeature('shipping_places')) {
Severity: Minor
Found in code/app/Formatters/User.php - About 25 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 printablePeriodic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function printablePeriodic($value)
{
    if (empty($value))
        return '';

Severity: Minor
Found in code/app/Helpers/Dates.php - About 25 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 classByRule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function classByRule($rule_id)
{
    $all_permissions = allPermissions();

    foreach ($all_permissions as $class => $rules) {
Severity: Minor
Found in code/app/Helpers/Permissions.php - About 25 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 toMail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function toMail($notifiable)
    {
        $message = $this->initMailMessage($notifiable);
        $message->subject(_i('Nuova notifica da %s', [$notifiable->gas->name]));

Severity: Minor
Found in code/app/Notifications/GenericNotificationWrapper.php - About 25 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 formatIcons has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function formatIcons($icons)
    {
        $ret = '';

        if (!empty($icons)) {
Severity: Minor
Found in code/app/Models/Concerns/Iconable.php - About 25 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 getImporter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getImporter($type)
    {
        $ret = null;

        switch($type) {
Severity: Minor
Found in code/app/Importers/CSV/CSVImporter.php - About 25 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 targetsByAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function targetsByAction($actions, $exclude_trashed = true)
    {
        $actions = explode(',', $actions);
        $targets = [];

Severity: Minor
Found in code/app/Models/Concerns/RoleableTrait.php - About 25 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 resetCurrentBalances has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function resetCurrentBalances(&$current_status)
    {
        $currencies = Currency::enabled();

        $obj = $this->getActualObject();
Severity: Minor
Found in code/app/Models/Concerns/CreditableTrait.php - About 25 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 isEnabled has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function isEnabled()
    {
        if ($this->system) {
            foreach(systemParameters('Roles') as $ref) {
                if ($this->identifier == $ref->identifier()) {
Severity: Minor
Found in code/app/Role.php - About 25 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 importJSON has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function importJSON($target, $json)
    {
        $type = $json->type;

        /*
Severity: Minor
Found in code/app/Importers/GDXP/Transformations.php - About 25 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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run($request)
    {
        $imports = $request->input('import', []);
        $dates = $request->input('date', []);
        $senders = $request->input('sender_id', []);
Severity: Minor
Found in code/app/Importers/CSV/Movements.php - About 25 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 sortBookingsByShippingPlace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function sortBookingsByShippingPlace($bookings, $shipping_place)
    {
        if ($shipping_place == 0 || $shipping_place == 'all_by_name') {
            $bookings = self::sortByUserName($bookings);
        }
Severity: Minor
Found in code/app/Delivery.php - About 25 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 realPrice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function realPrice($rectify)
    {
        $offset = $this->price_offset;
        $product = $this->product;

Severity: Minor
Found in code/app/VariantCombo.php - About 25 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