chamilo/chamilo-lms

View on GitHub
public/plugin/ai_helper/AiHelperPlugin.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '192', column '34').
Open

            ->setRequestedAt(new DateTime())

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 '76', column '19').
Open

        $ai = new OpenAi($apiKey, $organizationId);

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

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            true)

Method name "AiHelperPlugin::get_name" is not in camel caps format
Open

    public function get_name(): string

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            true)

Closing parenthesis of a multi-line function call must be on a line by itself
Open

            true)

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            true)

Closing parenthesis of a multi-line function call must be on a line by itself
Open

            true)

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            true)

The method get_name is not named in camelCase.
Open

    public function get_name(): string
    {
        return 'ai_helper';
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status