app/Console/Commands/DoctorCommand.php
File DoctorCommand.php
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace App\Console\Commands;
use App\Enums\SongStorageType;
Function checkServiceIntegrations
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
private function checkServiceIntegrations(): void
{
if (!LastfmService::enabled()) {
$this->reportWarning('Last.fm integration', 'Not available');
} else {
- 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
DoctorCommand
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DoctorCommand extends Command
{
protected $signature = 'koel:doctor';
protected $description = 'Check Koel setup';
Method checkServiceIntegrations
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function checkServiceIntegrations(): void
{
if (!LastfmService::enabled()) {
$this->reportWarning('Last.fm integration', 'Not available');
} else {
Method handle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(): int
{
if (PHP_OS_FAMILY === 'Windows' || PHP_OS_FAMILY === 'Unknown') {
$this->components->error('This command is only available on Linux systems.');
Function reportErroneousResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private function reportErroneousResult(): void
{
$this->components->error('There are errors in your Koel setup. Koel will not work properly.');
if (File::isWritable(base_path('storage/logs/laravel.log'))) {
- 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"