markenwerk/php-slack-client

View on GitHub

Showing 42 of 42 total issues

Missing class import via use statement (line '99', column '14').
Open

            throw new \InvalidArgumentException('Expected the username as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackClient.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '149', column '14').
Open

            throw new \InvalidArgumentException('The icon URL is invalid.');
Severity: Minor
Found in src/SlackMessage.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '142', column '14').
Open

            throw new \InvalidArgumentException('Expected the channel name as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackClient.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '97', column '15').
Open

                throw new \InvalidArgumentException(
Severity: Minor
Found in src/SlackAttachment.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '175', column '14').
Open

            throw new \InvalidArgumentException('Expected the pretext as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackAttachment.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '197', column '14').
Open

            throw new \InvalidArgumentException('Expected the text as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackAttachment.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '121', column '14').
Open

            throw new \InvalidArgumentException('The channel name is invalid. It has to start with "#".');
Severity: Minor
Found in src/SlackClient.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            foreach ($slackMessage->getAttachments() as $attachment) {
                if (!isset($payload['attachments'])) {
                    $payload['attachments'] = array();
                }
                $payload['attachments'][] = $attachment->toArray();
Severity: Minor
Found in src/SlackClient.php and 1 other location - About 30 mins to fix
src/SlackAttachment.php on lines 226..231

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Missing class import via use statement (line '77', column '15').
Open

                throw new \InvalidArgumentException(
Severity: Minor
Found in src/SlackMessage.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        foreach ($this->getFields() as $field) {
            if (!isset($attachment['fields'])) {
                $attachment['fields'] = array();
            }
            $attachment['fields'][] = $field->toArray();
Severity: Minor
Found in src/SlackAttachment.php and 1 other location - About 30 mins to fix
src/SlackClient.php on lines 171..176

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Missing class import via use statement (line '52', column '14').
Open

            throw new \InvalidArgumentException('Expected the color as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackAttachment.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '55', column '14').
Open

            throw new \InvalidArgumentException('Expected the subdomain name as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackClient.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '77', column '14').
Open

            throw new \InvalidArgumentException('Expected the token as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackClient.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '54', column '14').
Open

            throw new \InvalidArgumentException('Expected the text as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackMessage.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '146', column '14').
Open

            throw new \InvalidArgumentException('Expected the icon URL as string. Got ' . $argumentType);
Severity: Minor
Found in src/SlackMessage.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '171', column '14').
Open

            throw new \InvalidArgumentException('Expected the unfurl links setting as boolean. Got ' . $argumentType);
Severity: Minor
Found in src/SlackMessage.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '145', column '14').
Open

            throw new \InvalidArgumentException('The mamber name is invalid. It has to start with "@".');
Severity: Minor
Found in src/SlackClient.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The 'getUnfurlLinks()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getUnfurlLinks()
    {
        return $this->unfurlLinks;
    }
Severity: Minor
Found in src/SlackMessage.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

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

The 'getUnfurlMedia()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getUnfurlMedia()
    {
        return $this->unfurlMedia;
    }
Severity: Minor
Found in src/SlackMessage.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

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

The 'getShort()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getShort()
    {
        return $this->short;
    }
Severity: Minor
Found in src/SlackAttachmentField.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

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

Severity
Category
Status
Source
Language