chamilo/chamilo-lms

View on GitHub
public/plugin/zoom/lib/ZoomPlugin.php

Summary

Maintainability
A
0 mins
Test Coverage

The method copyFileToCourse() has an NPath complexity of 512. The configured NPath complexity threshold is 200.
Open

    public function copyFileToCourse($meeting, $file, $name)
    {
        $course = $meeting->getCourse();
        if (null === $course) {
            throw new Exception('This meeting is not linked to a course');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method getStartOrJoinMeetingURL() has an NPath complexity of 236. The configured NPath complexity threshold is 200.
Open

    public function getStartOrJoinMeetingURL($meeting)
    {
        $status = $meeting->getMeetingInfoGet()->status;
        $userId = api_get_user_id();
        $currentUser = api_get_user_entity($userId);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The class ZoomPlugin has a coupling between objects value of 31. Consider to reduce the number of dependencies under 13.
Open

class ZoomPlugin extends Plugin
{
    const RECORDING_TYPE_CLOUD = 'cloud';
    const RECORDING_TYPE_LOCAL = 'local';
    const RECORDING_TYPE_NONE = 'none';
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Missing class import via use statement (line '235', column '21').
Open

        $form = new FormValidator('search');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '257', column '24').
Open

            $end = new DateTime();
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '245', column '30').
Open

                $start = new DateTime();
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '286', column '21').
Open

        $form = new FormValidator('edit', 'post', $_SERVER['REQUEST_URI']);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '301', column '52').
Open

                $meetingInfoGet->start_time = (new DateTime($form->getSubmitValue('startTime')))->format(
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '240', column '25').
Open

        $oneMonth = new DateInterval('P1M');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '255', column '26').
Open

            $start = new DateTime();
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '243', column '30').
Open

                $start = new DateTime($form->getSubmitValue('start'));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '249', column '28').
Open

                $end = new DateTime($form->getSubmitValue('end'));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '251', column '28').
Open

                $end = new DateTime();
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '418', column '21').
Open

        $form = new FormValidator('register', 'post', $_SERVER['REQUEST_URI']);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '349', column '21').
Open

        $form = new FormValidator('delete', 'post', api_get_self().'?meetingId='.$id);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '474', column '21').
Open

        $form = new FormValidator('fileForm', 'post', $_SERVER['REQUEST_URI']);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '987', column '31').
Open

                    throw new Exception($this->get_lang('YouAreNotRegisteredToThisMeeting'));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '638', column '23').
Open

            throw new Exception("Could not set curl options: ".curl_error($curl));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '829', column '25').
Open

                    new DateTime($form->getSubmitValue('startTime')),
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '589', column '23').
Open

            throw new Exception('This meeting is not linked to a course');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '1233', column '23').
Open

            throw new Exception($this->get_lang('CannotRegisterWithoutEmailAddress'));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '615', column '23').
Open

            throw new Exception('This meeting is not linked to a course');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '623', column '23').
Open

            throw new Exception('tmpfile() returned false');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '641', column '23').
Open

            throw new Exception("curl_exec failed: ".curl_error($curl));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '627', column '23').
Open

            throw new Exception('Could not init curl: '.curl_error($curl));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '593', column '23').
Open

            throw new Exception('This meeting is not linked to a valid course');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '619', column '23').
Open

            throw new Exception('This meeting is not linked to a valid course');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '703', column '21').
Open

        $form = new FormValidator('createInstantMeetingForm', 'post', api_get_self().'?'.$extraUrl, '_blank');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '995', column '35').
Open

                        throw new Exception($this->get_lang('YouAreNotRegisteredToThisMeeting'));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '732', column '21').
Open

        $form = new FormValidator('scheduleMeetingForm', 'post', api_get_self().'?'.$extraUrl);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '683', column '23').
Open

            throw new Exception('Could not handle uploaded document');
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '976', column '43').
Open

                                throw new Exception($this->get_lang('YouAreNotRegisteredToThisMeeting'));
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '1345', column '44').
Open

        $meetingInfoGet->start_time = (new DateTime())->format(DateTimeInterface::ISO8601);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 method getAdminSearchForm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $start = new DateTime();
            $start->sub($oneMonth);
            $end = new DateTime();
            $end->add($oneMonth);
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getStartOrJoinMeetingURL uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                    } else {
                        $isSubscribed = CourseManager::is_user_subscribed_in_course(
                            $userId,
                            $courseCode,
                            true,
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getScheduleMeetingForm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $form->setDefaults(
                [
                    'duration' => 60,
                    'userRegistration' => 'RegisterAllCourseUsers',
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getScheduleMeetingForm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $form->addSelect('type', $this->get_lang('ConferenceType'), $options);
                }
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getScheduleMeetingForm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // To course
            $form->addHidden('type', 'course');
        }
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getToolbar uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $actionsLeft .=
                Display::url(
                    Display::getMdiIcon(ToolIcon::VIDEOCONFERENCE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, $this->get_lang('Meetings')),
                    api_get_path(WEB_PLUGIN_PATH).'zoom/start.php?'.api_get_cidreq()
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$file'.
Open

    public function createLinkToFileInCourse($meeting, $file, $name)
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 local variables such as '$sessionId'.
Open

        $sessionId = 0;
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused local variables such as '$groupId'.
Open

        $groupId = 0;
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused parameters such as '$name'.
Open

    public function createLinkToFileInCourse($meeting, $file, $name)
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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 '$name'.
Open

    public function copyFileToCourse($meeting, $file, $name)
Severity: Minor
Found in public/plugin/zoom/lib/ZoomPlugin.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

Variable "start_time" is not in valid camel caps format
Open

        $meetingInfoGet->start_time = (new DateTime())->format(DateTimeInterface::ISO8601);

Variable "recording_type" is not in valid camel caps format
Open

                            $file->recording_type,

Variable "recording_type" is not in valid camel caps format
Open

                                    $name = $file->recording_type;

Variable "recording_type" is not in valid camel caps format
Open

                                $file->recording_type,

Missing function doc comment
Open

    public function getToolbar($returnUrl = '')

Missing function doc comment
Open

    public function hasRecordingAvailable()

Variable "start_time" is not in valid camel caps format
Open

                $meetingInfoGet->start_time = (new DateTime($form->getSubmitValue('startTime')))->format(

Missing function doc comment
Open

    public function getRecordingSetting()

Case breaking statement indented incorrectly; expected 16 spaces, found 20
Open

                    return $registrant->getCreatedRegistration()->join_url;

Variable "start_time" is not in valid camel caps format
Open

        $meetingInfoGet->start_time = $startTime->format(DateTimeInterface::ISO8601);

Variable "file_type" is not in valid camel caps format
Open

                            $file->file_type,

Variable "file_type" is not in valid camel caps format
Open

                                $file->file_type

Terminating statement must be indented to the same level as the CASE body
Open

                    return $registrant->getCreatedRegistration()->join_url;

Variable "file_size" is not in valid camel caps format
Open

                            $file->file_size

Line indented incorrectly; expected 16 spaces, found 20
Open

                    if (null == $registrant) {

Line indented incorrectly; expected 16 spaces, found 20
Open

                    }

There are no issues that match your filters.

Category
Status