willpower232/TOTPBTF3

View on GitHub

Showing 42 of 42 total issues

Expected 1 space after FUNCTION keyword; 0 found
Open

Route::prefix('tokens')->name('tokens')->group(function() {
Severity: Minor
Found in routes/web.php by phpcodesniffer

Expected 1 space after FUNCTION keyword; 0 found
Open

Route::bind('token', function($tokenidhash) {
Severity: Minor
Found in routes/web.php by phpcodesniffer

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

    public function store()
    {
        if (config('app.readonly')) {
            abort(404);
        }
Severity: Minor
Found in app/Http/Controllers/TokensController.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

Expected 1 space after FUNCTION keyword; 0 found
Open

Route::prefix('login')->name('session')->group(function() {
Severity: Minor
Found in routes/web.php by phpcodesniffer

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

    function breadcrumbsFromAPath($trail, $path = "/")
    {
        $trail->push('Codes', route('tokens.code'));

        $carry = "";
Severity: Minor
Found in routes/breadcrumbs.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

Spaces must be used to indent lines; tabs are not allowed
Open

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

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::get('/', 'SessionsController@create')->name('.create');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::get('{token}/delete', 'TokensController@delete')->name('.delete');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::post('/', 'SessionsController@store')->name('.store');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::get('{token}', 'TokensController@show')->name('.show');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    return Token::where('user_id', auth()->guard()->user()->id)
Severity: Minor
Found in routes/web.php by phpcodesniffer

Line exceeds 120 characters; contains 129 characters
Open

        'protected_key_encoded' => (KeyProtectedByPassword::createRandomPasswordProtectedKey('secret'))->saveToAsciiSafeString(),

Spaces must be used to indent lines; tabs are not allowed
Open

    return view('error', array(
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::delete('{token}/delete', 'TokensController@destroy')->name('.destroy');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        'errormessage' => 'offline'
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::post('/', 'TokensController@store')->name('.store');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::get('{token}/edit', 'TokensController@edit')->name('.edit');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::post('/', 'SessionsController@update')->name('.update');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::post('{token}', 'TokensController@update')->name('.update');
Severity: Minor
Found in routes/web.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    Route::get('/edit', 'SessionsController@edit')->name('.edit');
Severity: Minor
Found in routes/web.php by phpcodesniffer
Severity
Category
Status
Source
Language