chamilo/chamilo-lms

View on GitHub
public/main/admin/user_import.php

Summary

Maintainability
A
0 mins
Test Coverage

The function complete_missing_data() has an NPath complexity of 1024. The configured NPath complexity threshold is 200.
Open

function complete_missing_data($user)
{
    global $purification_option_for_usernames;

    $username = isset($user['UserName']) ? $user['UserName'] : '';
Severity: Minor
Found in public/main/admin/user_import.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 function validate_data() has an NPath complexity of 198291. The configured NPath complexity threshold is 200.
Open

function validate_data($users, $checkUniqueEmail = false)
{
    global $defined_auth_sources;
    $usernames = [];

Severity: Minor
Found in public/main/admin/user_import.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 function save_data() has an NPath complexity of 9372. The configured NPath complexity threshold is 200.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.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 function parse_csv_data() has an NPath complexity of 9232. The configured NPath complexity threshold is 200.
Open

function parse_csv_data($users, $fileName, $sendEmail = 0, $checkUniqueEmail = true, $resumeImport = false)
{
    $usersFromOrigin = $users;
    $allowRandom = ('true' === api_get_setting('platform.generate_random_login'));
    if ($allowRandom) {
Severity: Minor
Found in public/main/admin/user_import.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

Missing class import via use statement (line '434', column '20').
Open

    $crawler = new \Symfony\Component\DomCrawler\Crawler();
Severity: Minor
Found in public/main/admin/user_import.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 '344', column '24').
Open

        $factory = new RandomLib\Factory();
Severity: Minor
Found in public/main/admin/user_import.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 '221', column '20').
Open

        $efo = new ExtraFieldOption('user');
Severity: Minor
Found in public/main/admin/user_import.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 '219', column '22').
Open

    $usergroup = new UserGroupModel();
Severity: Minor
Found in public/main/admin/user_import.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 '463', column '22').
Open

        $table = new HTML_Table(['class' => 'table table-responsive']);
Severity: Minor
Found in public/main/admin/user_import.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 '40', column '22').
Open

    $usergroup = new UserGroupModel();
Severity: Minor
Found in public/main/admin/user_import.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 validate_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $classExistList[] = $info['id'];
                }
Severity: Minor
Found in public/main/admin/user_import.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 processUsers uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $importData['log_messages'] = $warningMessage;
        }
Severity: Minor
Found in public/main/admin/user_import.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 complete_missing_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        $user['UserName'] = UserManager::purify_username(
            $user['UserName'],
            $purification_option_for_usernames
        );
Severity: Minor
Found in public/main/admin/user_import.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 save_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $returnMessage = Display::return_message(get_lang('Error'), 'warning');
            }
Severity: Minor
Found in public/main/admin/user_import.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 parse_csv_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        $users = array_splice($users, 0, $readMax);
    }
Severity: Minor
Found in public/main/admin/user_import.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

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

    $mandatory_fields = ['LastName', 'FirstName'];

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

                    UserManager::update_extra_field_value($user_id, $key, $value);

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

        $result_xml .= $spaces.'<'.$extra[1].'>xxx</'.$extra[1].'>';

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

    $list_reponse[] = api_get_path(WEB_PATH);

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

        $inserted_in_course = [];

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

    if (in_array($ext_import_file, $allowed_file_mimetype)) {

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

$count_fields = count($extra_fields);

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

    $defined_auth_sources = array_merge($defined_auth_sources, array_keys($extAuthSource));

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

    $ext_import_file = $uploadInfo['extension'];

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

        if (0 === strcmp($file_type, 'csv') &&

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

        } elseif (0 === strcmp($file_type, 'xml') && $ext_import_file == $allowed_file_mimetype[1]) {

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

if ('' != $result_xml) {

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

$purification_option_for_usernames = false;

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

            if (!in_array($user['AuthSource'], $defined_auth_sources)) {

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

    global $purification_option_for_usernames;

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

    global $inserted_in_course, $extra_fields;

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

                                $inserted_in_course[$course] = $course_info['title'];

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

                        $usergroup->subscribe_users_to_usergroup($id, [$user_id], false);

Consider putting global function "parse_xml_data" in a static class
Open

function parse_xml_data($file)

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

$tool_name = get_lang('Import users list');

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

    if (in_array($ext_import_file, $allowed_file_mimetype)) {

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

            $error_kind_file = false;

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

        } elseif (0 === strcmp($file_type, 'xml') && $ext_import_file == $allowed_file_mimetype[1]) {

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

$form->addHeader($tool_name);

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

$count_fields = count($extra_fields);

Consider putting global function "parse_csv_data" in a static class
Open

function parse_csv_data($users, $fileName, $sendEmail = 0, $checkUniqueEmail = true, $resumeImport = false)

Consider putting global function "processUsers" in a static class
Open

function processUsers(&$users, $sendMail)

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

        } elseif (0 === strcmp($file_type, 'xml') && $ext_import_file == $allowed_file_mimetype[1]) {

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

        foreach ($mandatory_fields as $field) {

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

    global $inserted_in_course, $extra_fields;

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

                            $result = CourseManager::subscribeUser($user_id, $course_info['real_id'], $user['Status']);

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

                                $inserted_in_course[$course] = $course_info['title'];

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

$list_reponse = [];

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

        $defined_auth_sources

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

    $content .= implode(';', $list_reponse).';';

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

    global $defined_auth_sources;

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

        $mandatory_fields[] = 'Email';

Consider putting global function "complete_missing_data" in a static class
Open

function complete_missing_data($user)

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

$this_section = SECTION_PLATFORM_ADMIN;

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

    $allowed_file_mimetype = ['csv', 'xml'];

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

            $ext_import_file == $allowed_file_mimetype[0]

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

        $list_reponse[] = 'xxx';

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

    $content .= ' <br /><span style="color:red;">'.$result_xml;

Consider putting global function "validate_data" in a static class
Open

function validate_data($users, $checkUniqueEmail = false)

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

            $ext_import_file == $allowed_file_mimetype[0]

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

            $error_kind_file = false;

Multi-line function call not indented correctly; expected 0 spaces but found 4
Open

    ).';xxx;english/spanish/(other);xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;">';

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

                            $result = CourseManager::subscribeUser($user_id, $course_info['real_id'], $user['Status']);

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

    $defined_auth_sources = array_merge($defined_auth_sources, array_keys($extAuthSource));

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

$result_xml = '';

Consider putting global function "save_data" in a static class
Open

function save_data($users, $sendMail = false)

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

            if ($user_id) {

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

                                [$user_id],

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

$defined_auth_sources[] = PLATFORM_AUTH_SOURCE;

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

$extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', true);

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

            $result_xml .= '<br/>';

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

        '/',

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

            $purification_option_for_usernames

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

        if ($i != $count_fields - 1) {

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

        $defined_auth_sources

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

    if (!isset($inserted_in_course)) {

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

                            $course_info = api_get_course_info($course);

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

    $file_type = $_POST['file_type'];

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

    $error_kind_file = true;

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

        if ($error_kind_file) {

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

Display::display_header($tool_name);

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

if ($count_fields > 0) {

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

if (count($list_reponse) > 0) {

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

            $user_id = UserManager::create_user(

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

                foreach ($extra_fields as $extras) {

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

    foreach ($extra_fields as $extra) {

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

        &lt;AuthSource&gt;'.implode(' / ', $defined_auth_sources).'&lt;/AuthSource&gt;

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

        $defined_auth_sources

Multi-line function call not indented correctly; expected 0 spaces but found 4
Open

    ).';xxx;english/spanish/(other);xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;">';

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

        '/',

The variable $mandatory_fields is not named in camelCase.
Open

function validate_data($users, $checkUniqueEmail = false)
{
    global $defined_auth_sources;
    $usernames = [];

Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $purification_option_for_usernames is not named in camelCase.
Open

function complete_missing_data($user)
{
    global $purification_option_for_usernames;

    $username = isset($user['UserName']) ? $user['UserName'] : '';
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $inserted_in_course is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_id is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_info is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_id is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $inserted_in_course is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_id is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $inserted_in_course is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $purification_option_for_usernames is not named in camelCase.
Open

function complete_missing_data($user)
{
    global $purification_option_for_usernames;

    $username = isset($user['UserName']) ? $user['UserName'] : '';
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_id is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_id is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_info is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $defined_auth_sources is not named in camelCase.
Open

function validate_data($users, $checkUniqueEmail = false)
{
    global $defined_auth_sources;
    $usernames = [];

Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $defined_auth_sources is not named in camelCase.
Open

function validate_data($users, $checkUniqueEmail = false)
{
    global $defined_auth_sources;
    $usernames = [];

Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $inserted_in_course is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_info is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $mandatory_fields is not named in camelCase.
Open

function validate_data($users, $checkUniqueEmail = false)
{
    global $defined_auth_sources;
    $usernames = [];

Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $extra_fields is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $mandatory_fields is not named in camelCase.
Open

function validate_data($users, $checkUniqueEmail = false)
{
    global $defined_auth_sources;
    $usernames = [];

Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $extra_fields is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_id is not named in camelCase.
Open

function save_data($users, $sendMail = false)
{
    global $inserted_in_course, $extra_fields;

    // Not all scripts declare the $inserted_in_course array (although they should).
Severity: Minor
Found in public/main/admin/user_import.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status