ampache/ampache

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

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$gtypes'.
Open

    public static function insert(array $data, ?array $gtypes = array(), ?array $options = array()): int
Severity: Minor
Found in src/Repository/Model/Clip.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$options'.
Open

    public static function insert(array $data, ?array $gtypes = array(), ?array $options = array()): int
Severity: Minor
Found in src/Repository/Model/Clip.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST)
Open

    public ?int $artist;
Severity: Critical
Found in src/Repository/Model/Clip.php by phan

The parameter $object_type is not named in camelCase.
Open

    public static function migrate($object_type, $old_object_id, $new_object_id)
    {
        if ($object_type == 'artist') {
            $sql    = "UPDATE `clip` SET `artist` = ? WHERE `artist` = ?";
            $params = array($new_object_id, $old_object_id);
Severity: Minor
Found in src/Repository/Model/Clip.php by phpmd

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

The parameter $old_object_id is not named in camelCase.
Open

    public static function migrate($object_type, $old_object_id, $new_object_id)
    {
        if ($object_type == 'artist') {
            $sql    = "UPDATE `clip` SET `artist` = ? WHERE `artist` = ?";
            $params = array($new_object_id, $old_object_id);
Severity: Minor
Found in src/Repository/Model/Clip.php by phpmd

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

The parameter $clip_id is not named in camelCase.
Open

    public function __construct($clip_id = 0)
    {
        if (!$clip_id) {
            return;
        }
Severity: Minor
Found in src/Repository/Model/Clip.php by phpmd

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

The parameter $new_object_id is not named in camelCase.
Open

    public static function migrate($object_type, $old_object_id, $new_object_id)
    {
        if ($object_type == 'artist') {
            $sql    = "UPDATE `clip` SET `artist` = ? WHERE `artist` = ?";
            $params = array($new_object_id, $old_object_id);
Severity: Minor
Found in src/Repository/Model/Clip.php by phpmd

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

Method name "_get_artist_id" should not be prefixed with an underscore to indicate visibility
Open

    private static function _get_artist_id($data): ?int

There are no issues that match your filters.

Category
Status