Showing 90 of 91 total issues
The class ApiTest has 12 public methods. Consider refactoring ApiTest to keep number of public methods under 10. Open
class ApiTest extends TestCase
{
/**
* Test Index of the API.
*
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
User
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use Authenticatable, Authorizable, Eloquence, Mappable;
/**
Method createPoolRoom
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createPoolRoom(User $user): bool
{
$room = (new Room())->store("{$user->name}'s room", "{$user->name} has entered the building", 'model_h', 25, 12, 307, 3104, 1.10, $user->uniqueId, $user->name);
$user->update(['home_room' => $room->id]);
Avoid excessively long class names like CreateChocolateyUsersPhotosReportedCategoriesTable. Keep class name length under 40. Open
class CreateChocolateyUsersPhotosReportedCategoriesTable extends Migration
{
/**
* Run the migrations.
*
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Avoid excessively long class names like CreateChocolateyShopPaymentCategoriesTable. Keep class name length under 40. Open
class CreateChocolateyShopPaymentCategoriesTable extends Migration
{
/**
* Run the migrations.
*
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Avoid excessively long class names like CreateChocolateyUsersSecurityTrustedTable. Keep class name length under 40. Open
class CreateChocolateyUsersSecurityTrustedTable extends Migration
{
/**
* Run the migrations.
*
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Avoid excessively long variable names like $buildersClubFurniLimit. Keep variable name length under 20. Open
public $buildersClubFurniLimit = 0;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid using short method names like CreateChocolateyUsersPhotosReportedTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_users_photos_reported', function (Blueprint $table) {
$table->increments('id');
$table->integer('photo_id');
- 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 CreateChocolateyUsersSecurityTrustedTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_users_security_trusted', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
- 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 CreateChocolateyShopPaymentCheckoutTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_shop_payment_checkout', function (Blueprint $table) {
$table->increments('id');
$table->string('category', 50)->default('online');
- 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 CreateChocolateyUsersIdTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_users_id', function (Blueprint $table) {
$table->string('mail', 150);
$table->enum('mail_verified', ['0', '1'])->default('0');
- 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 CreateChocolateyShopPaymentCategoriesTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_shop_payment_categories', function (Blueprint $table) {
$table->increments('id');
$table->string('country_code', 5)->default('all');
- 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 CreateChocolateyShopCountriesTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_shop_countries', function (Blueprint $table) {
$table->increments('id');
$table->string('countryCode', 5)->default('all');
- 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 CreateChocolateyUsersPreferencesTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_users_preferences', function (Blueprint $table) {
$table->integer('user_id');
$table->enum('emailFriendRequestNotificationEnabled', ['1', '0'])->default('0');
- 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 CreateChocolateyShopItemsTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_shop_items', function (Blueprint $table) {
$table->increments('id');
$table->string('countryCode', 5)->default('all');
- 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 CreateChocolateyShopHistoryTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_shop_history', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
- 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 CreateChocolateyArticlesCategoriesTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_articles_categories', function (Blueprint $table) {
$table->string('link', 50);
$table->string('translate', 125);
- 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 CreateChocolateyUsersMailRequestsTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_users_mail_requests', function (Blueprint $table) {
$table->increments('id');
$table->string('token', 255);
- 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 CreateChocolateyUsersPhotosReportedCategoriesTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_users_photos_reported_categories', function (Blueprint $table) {
$table->integer('report_category');
$table->string('description', 255);
- 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 CreateChocolateyUsersPhotosLikesTable::up(). The configured minimum method name length is 3. Open
public function up()
{
Schema::create('chocolatey_users_photos_likes', function (Blueprint $table) {
$table->increments('id');
$table->integer('photo_id');
- 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
}
}