Showing 15 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));
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) ||
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"
Further reading
Function store
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function store()
{
if (config('app.readonly')) {
abort(404);
}
- 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
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 = "";
- 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"