src/Repository/Model/ModelFactoryInterface.php
Class "ModelFactoryInterface" has 21 methods, which is greater than 20 authorized. Split it into smaller classes. Open
Open
interface ModelFactoryInterface
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
Return type of createTvShow()
is undeclared type \Ampache\Repository\Model\TvShow
Open
Open
public function createTvShow(
- Exclude checks
Return type of createRating()
is undeclared type \Ampache\Repository\Model\Rating
Open
Open
public function createRating(
- Exclude checks
Return type of createVideo()
is undeclared type \Ampache\Repository\Model\Video
Open
Open
public function createVideo(
- Exclude checks
Return type of createAlbumDisk()
is undeclared type \Ampache\Repository\Model\AlbumDisk
Open
Open
public function createAlbumDisk(
- Exclude checks
Return type of createSong()
is undeclared type \Ampache\Repository\Model\Song
Open
Open
public function createSong(
- Exclude checks
Return type of createPodcast()
is undeclared type \Ampache\Repository\Model\Podcast
Open
Open
public function createPodcast(
- Exclude checks
Return type of createPodcastEpisode()
is undeclared type \Ampache\Repository\Model\Podcast_Episode
Open
Open
public function createPodcastEpisode(
- Exclude checks
Return type of createTmpPlaylist()
is undeclared type \Ampache\Repository\Model\Tmp_Playlist
Open
Open
public function createTmpPlaylist(
- Exclude checks
Return type of createUser()
is undeclared type \Ampache\Repository\Model\User
Open
Open
public function createUser(
- Exclude checks
Return type of createArtist()
is undeclared type \Ampache\Repository\Model\Artist
Open
Open
public function createArtist(
- Exclude checks
Return type of createLiveStream()
is undeclared type \Ampache\Repository\Model\Live_Stream
Open
Open
public function createLiveStream(
- Exclude checks
Return type of createAlbum()
is undeclared type \Ampache\Repository\Model\Album
Open
Open
public function createAlbum(
- Exclude checks
Return type of createWanted()
is undeclared type \Ampache\Repository\Model\Wanted
Open
Open
public function createWanted(
- Exclude checks
Return type of createBroadcast()
is undeclared type \Ampache\Repository\Model\Broadcast
Open
Open
public function createBroadcast(
- Exclude checks
Return type of createSearch()
is undeclared type \Ampache\Repository\Model\Search
Open
Open
public function createSearch(
- Exclude checks
Return type of createDemocratic()
is undeclared type \Ampache\Repository\Model\Democratic
Open
Open
public function createDemocratic(
- Exclude checks
Parameter $user
has undeclared type ?\Ampache\Repository\Model\User
Open
Open
public function createSearch(
- Exclude checks
The parameter $browse_id is not named in camelCase. Open
Open
public function createBrowse(
?int $browse_id = null,
bool $cached = true
): Browse;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Avoid variables with short names like $id. Configured minimum length is 3. Open
Open
public function createPlaylist(int $id): Playlist;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}