JoseCage/kallun-api

View on GitHub

Showing 26 of 26 total issues

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class CreatePasswordResetsTable extends Migration

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class CreateUsersTable extends Migration

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class CreateSlangsTable extends Migration

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class DatabaseSeeder extends Seeder

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 10 and the first side effect is on line 24.
Open

<?php
Severity: Minor
Found in public/index.php by phpcodesniffer

Expected 1 space after FUNCTION keyword; 0 found
Open

Route::group(['prefix' => 'v1', 'namespace' => 'API'], function() {
Severity: Minor
Found in routes/api.php by phpcodesniffer

Expected 1 space after FUNCTION keyword; 0 found
Open

    Route::group(['prefix' => 'slangs'], function($slang) {
Severity: Minor
Found in routes/api.php by phpcodesniffer

Expected 1 space after FUNCTION keyword; 0 found
Open

        static::creating(function($model) {
Severity: Minor
Found in app/Traits/UuidTrait.php by phpcodesniffer

Expected 1 space after FUNCTION keyword; 0 found
Open

    Route::group(['prefix' => 'auth', 'namespace' => 'Auth'], function($auth) {
Severity: Minor
Found in routes/api.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

});
Severity: Minor
Found in routes/api.php by phpcodesniffer

Line indented incorrectly; expected at least 8 spaces, found 7
Open

       return [
Severity: Minor
Found in app/Http/Resources/Slang.php by phpcodesniffer

Line indented incorrectly; expected at least 8 spaces, found 7
Open

       ];
Severity: Minor
Found in app/Http/Resources/Slang.php by phpcodesniffer

Headers should be surrounded by blank lines
Open

# Kallun
Severity: Info
Found in README.md by markdownlint

MD022 - Headers should be surrounded by blank lines

Tags: headers, blank_lines

Aliases: blanks-around-headers

This rule is triggered when headers (any style) are either not preceded or not followed by a blank line:

# Header 1
Some text

Some more text
## Header 2

To fix this, ensure that all headers have a blank line both before and after (except where the header is at the beginning or end of the document):

# Header 1

Some text

Some more text

## Header 2

Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

Define a constant instead of duplicating this literal "The selected :attribute is invalid." 3 times.
Open

    'exists'               => 'The selected :attribute is invalid.',
Severity: Critical
Found in resources/lang/en/validation.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Remove this commented out code.
Open

        // $this->call(UsersTableSeeder::class);
Severity: Major
Found in database/seeds/DatabaseSeeder.php by sonar-php

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Define a constant instead of duplicating this literal "The :attribute format is invalid." 3 times.
Open

    'not_regex'            => 'The :attribute format is invalid.',
Severity: Critical
Found in resources/lang/en/validation.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Remove this commented out code.
Open

        //          ->hourly();
Severity: Major
Found in app/Console/Kernel.php by sonar-php

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Remove this commented out code.
Open

      //  $this->mapWebRoutes();

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Define a constant instead of duplicating this literal "numeric" 9 times.
Open

        'numeric' => 'The :attribute must be between :min and :max.',
Severity: Critical
Found in resources/lang/en/validation.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Remove this commented out code.
Open

    //   protected $signature = 'make:model';

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
Severity
Category
Status
Source
Language