Showing 985 of 985 total issues
Avoid using short method names like CreateConsultationsParticipantsTable::up(). The configured minimum method name length is 3. Open
Open
public function up(): void
{
Schema::create('consultations_participants', function (Blueprint $table) {
$table->id();
$table->bigInteger('consultation_id')->unsigned()->index();
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like AddColumnsDateAndStatusToOrders::up(). The configured minimum method name length is 3. Open
Open
public function up(): void
{
if (
Schema::hasTable('orders') &&
!Schema::hasColumns('orders', ['executed_at', 'executed_status'])
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Avoid using short method names like CreateConsultationsTable::up(). The configured minimum method name length is 3. Open
Open
public function up(): void
{
Schema::create('consultations', function (Blueprint $table) {
$table->id();
$table->bigInteger('author_id')->unsigned()->nullable();
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
Method forCurrentUserResponse
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function forCurrentUserResponse(
ListConsultationsRequest $listConsultationsRequest
): AnonymousResourceCollection {
$search = $listConsultationsRequest->except(['limit', 'skip', 'order', 'order_by', 'paginate']);
$consultations = $this->getConsultationsListForCurrentUser($search);
Method prepareFilters
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function prepareFilters(array $search)
{
$dto = new self($search);
$user = auth()->user();
Method generateJitsiUrlForEmail
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function generateJitsiUrlForEmail(int $consultationTermId, int $userId): ?string
{
$consultationTerm = $this->consultationUserRepositoryContract->find($consultationTermId);
$isModerator = false;
$configOverwrite = [];
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function run()
{
// create permissions
$admin = Role::findOrCreate(UserRole::ADMIN, 'api');
$tutor = Role::findOrCreate(UserRole::TUTOR, 'api');
Function prepareFilters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function prepareFilters(array $search)
{
$dto = new self($search);
$user = auth()->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
Method toArray
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function toArray($request)
{
$consultationServiceContract = app(ConsultationServiceContract::class);
$fields = [
'consultation_term_id' => $this->getKey(),
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class AddConsultationIdColumnForConsultationTermsTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class AddSenderStatusInConsultationUserTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class RemoveNotUsedColumnsFromConsultationsTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class RemoveParticipantTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class RemoveMissingColumns extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class CreateConsultationsParticipantsTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class AddPivotTableForOrderItemsAndUser extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class AddProductColumnInConsultationUserTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class AddColumnsDateAndStatusToOrders extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class RemoveRedundantColumnsFromConsultationsTable extends Migration
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class ChangeColumnsInConsultationuserTable extends Migration
- Exclude checks