ampache/ampache

View on GitHub
src/Repository/Model/ModelFactoryInterface.php

Summary

Maintainability
A
0 mins
Test Coverage

Class "ModelFactoryInterface" has 21 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

interface ModelFactoryInterface

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

    public function createTvShow(

Return type of createRating() is undeclared type \Ampache\Repository\Model\Rating
Open

    public function createRating(

Return type of createVideo() is undeclared type \Ampache\Repository\Model\Video
Open

    public function createVideo(

Return type of createAlbumDisk() is undeclared type \Ampache\Repository\Model\AlbumDisk
Open

    public function createAlbumDisk(

Return type of createSong() is undeclared type \Ampache\Repository\Model\Song
Open

    public function createSong(

Return type of createPodcast() is undeclared type \Ampache\Repository\Model\Podcast
Open

    public function createPodcast(

Return type of createPodcastEpisode() is undeclared type \Ampache\Repository\Model\Podcast_Episode
Open

    public function createPodcastEpisode(

Return type of createTmpPlaylist() is undeclared type \Ampache\Repository\Model\Tmp_Playlist
Open

    public function createTmpPlaylist(

Return type of createUser() is undeclared type \Ampache\Repository\Model\User
Open

    public function createUser(

Return type of createArtist() is undeclared type \Ampache\Repository\Model\Artist
Open

    public function createArtist(

Return type of createLiveStream() is undeclared type \Ampache\Repository\Model\Live_Stream
Open

    public function createLiveStream(

Return type of createAlbum() is undeclared type \Ampache\Repository\Model\Album
Open

    public function createAlbum(

Return type of createWanted() is undeclared type \Ampache\Repository\Model\Wanted
Open

    public function createWanted(

Return type of createBroadcast() is undeclared type \Ampache\Repository\Model\Broadcast
Open

    public function createBroadcast(

Return type of createSearch() is undeclared type \Ampache\Repository\Model\Search
Open

    public function createSearch(

Return type of createDemocratic() is undeclared type \Ampache\Repository\Model\Democratic
Open

    public function createDemocratic(

Parameter $user has undeclared type ?\Ampache\Repository\Model\User
Open

    public function createSearch(

The parameter $browse_id is not named in camelCase.
Open

    public function createBrowse(
        ?int $browse_id = null,
        bool $cached = true
    ): Browse;

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

    public function createPlaylist(int $id): Playlist;

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;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

There are no issues that match your filters.

Category
Status