madbob/GASdottoNG

View on GitHub

Showing 437 of 494 total issues

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

    public function fixPayment()
    {
        $payment = $this->payment;

        if ($payment) {
Severity: Minor
Found in code/app/Booking.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 getProductConceptsAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getProductConceptsAttribute()
    {
        $ret = new Collection();

        foreach ($this->products as $product) {
Severity: Minor
Found in code/app/Order.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 getNameAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNameAttribute()
    {
        if ($this->active == false) {
            return _i('Nessun Valore');
        }
Severity: Minor
Found in code/app/Modifier.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 compressTable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function compressTable($user_columns, $data)
    {
        $compressed = [];

        $user_columns_count = count($user_columns);
Severity: Minor
Found in code/app/Printers/Concerns/Table.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 mapNewElements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function mapNewElements($value, &$cached, $createNew)
    {
        if (Str::startsWith($value, 'new:')) {
            $name = Str::after($value, 'new:');
            if (empty($name) == false) {
Severity: Minor
Found in code/app/Importers/CSV/CSVImporter.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 getAllClasses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAllClasses()
    {
        $ret = [];
        $permissions = allPermissions();

Severity: Minor
Found in code/app/Role.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 deepMergingAttributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function deepMergingAttributes($child, $first, $second)
    {
        $ret = $this->describingAttributesMerge($first, $second);

        foreach ($this->subArrayMerge() as $subarray) {
Severity: Minor
Found in code/app/Models/Concerns/ReducibleTrait.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 innerCache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function innerCache($name, $function)
    {
        if ($this->uses_global_cache) {
            $name = $this->globalKey($name);

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

    public function printableUserHeader()
    {
        $ret = $this->printableHeader();

        $user = Auth::user();
Severity: Minor
Found in code/app/Aggregate.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 activeValues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function activeValues($combos)
    {
        $ret = [];

        $combos = $combos->filter(function($combo) {
Severity: Minor
Found in code/app/VariantCombo.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 importXML has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function importXML($xml, $parent)
    {
        foreach($xml->children() as $p) {
            foreach($p->children() as $e) {
                $type = self::map($e->getName());
Severity: Minor
Found in code/app/Importers/GDXP/Contacts.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 attachApplication has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function attachApplication($obj)
    {
        $now = date('Y-m-d G:i:s');

        if (is_string($obj)) {
Severity: Minor
Found in code/app/Role.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 applyFunction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function applyFunction($obj, $movement, $op)
    {
        /*
            Inutile perdere tempo su movimenti che non intaccano i bilanci...
        */
Severity: Minor
Found in code/app/MovementType.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 fakeBookingStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function fakeBookingStatus($status, $booking)
    {
        $original_booking_status = null;

        if ($status == 'pending') {
Severity: Minor
Found in code/app/Printers/Concerns/Shipping.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 applicableModificationTypes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function applicableModificationTypes()
    {
        $inherit = $this->inheritModificationTypes();

        if (!is_null($inherit)) {
Severity: Minor
Found in code/app/Models/Concerns/ModifiableTrait.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 up has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function up()
    {
        Schema::table('roles', function (Blueprint $table) {
            $table->string('identifier')->default('');
            $table->boolean('system')->default(false);
Severity: Minor
Found in code/database/migrations/2022_12_01_181229_advanced_roles.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 renderHtml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function renderHtml()
    {
        $ret = '<table border="1" style="width: 100%" cellpadding="5">';

        if (empty($this->headers) == false) {
Severity: Minor
Found in code/app/Printers/Components/Table.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 validForInvoices has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function validForInvoices()
    {
        return $this->visibility && (
            ($this->sender_type == 'App\Gas' && ($this->target_type == 'App\Supplier' || $this->target_type == 'App\Invoice')) ||
            ($this->sender_type == 'App\Supplier' && $this->target_type == 'App\Gas') ||
Severity: Minor
Found in code/app/MovementType.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

Avoid too many return statements within this method.
Open

                return null;
Severity: Major
Found in code/app/Singletons/ModifierEngine.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $this->errorResponse($e->getMessage());
    Severity: Major
    Found in code/app/Http/Controllers/ImportController.php - About 30 mins to fix
      Severity
      Category
      Status
      Source
      Language