Showing 42 of 42 total issues
Method update
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update()
{
if (config('app.readonly')) {
abort(404);
}
Method handle
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$email = $this->ask('Users email address?');
$password = $this->secret('Password for user?');
Method handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$email = $this->ask('Users email address?');
$password = $this->secret('Password for user?');
Method store
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store()
{
if (config('app.readonly')) {
abort(404);
}
Function getValidationRules
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function getValidationRules(string $for = '')
{
$rules = array();
if ($for == 'login' || $for == 'create' || $for == 'update') {
- Read upRead up
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
Method boot
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
// if your database type doesn't match https://laravel-news.com/laravel-5-4-key-too-long-error
// \Illuminate\Support\Facades\Schema::defaultStringLength(255);
Method getFoldersOrTokensFromPath
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFoldersOrTokensFromPath($path = '/')
{
// guarantee input into the function
$path = Token::formatPath($path);
Method getValidationRules
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getValidationRules(string $for = '')
{
$rules = array();
if ($for == 'login' || $for == 'create' || $for == 'update') {
Method getFunctions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFunctions()
{
return array(
/**
* Based on https://www.filamentgroup.com/lab/inlining-cache.html
Method getQRCode
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getQRCode()
{
// anonymous function to simplify hexadecimal colour input
$hexToRGB = function ($input) {
return array_map('hexdec', str_split(trim($input, '#'), 2));
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class CreateTokensTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class DatabaseSeeder extends Seeder
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class CreatePasswordResetsTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class CreateUsersTable extends Migration
- Exclude checks
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 6 and the first side effect is on line 28. Open
<?php
- Exclude checks
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
- Exclude checks
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$email = $this->ask('Users email address?');
$password = $this->secret('Password for user?');
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if (response.status < 400 &&
ev.request.url.match(location.hostname) &&
response.headers.has('Content-Type') &&
(
response.headers.get('Content-Type').match(/^image\//i) ||
Expected 1 space after FUNCTION keyword; 0 found Open
Route::prefix('profile')->name('session')->group(function() {
- Exclude checks
Function handle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$email = $this->ask('Users email address?');
$password = $this->secret('Password for user?');
- Read upRead up
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"