chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/export.lib.inc.php

Summary

Maintainability
A
0 mins
Test Coverage

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

        $pdf = new PDF($params['format'], $params['orientation'], $params);

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 '180', column '20').
Open

        $pdf = new PDF($params['format'], $params['orientation'], $params);

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 '196', column '22').
Open

        $table = new HTML_Table(['class' => 'table table-hover table-striped data_table', 'repeat_header' => '1']);

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

Avoid unused parameters such as '$format'.
Open

    public static function htmlToOdt($html, $name, $format = 'odt')

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 static function htmlToOdt($html, $name, $format = 'odt')

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

The parameter $item_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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 $wrapper_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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

Missing parameter name
Open

     * @param string Name of common tag to place each line in

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

        foreach ($data as &$printable_data_row) {

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

        $wrapper_tagname = null,

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

        if (!is_null($wrapper_tagname)) {

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

            foreach ($printable_data_row as &$printable_data_cell) {

Method name "Export::export_table_pdf" is not in camel caps format
Open

    public static function export_table_pdf($data, $params = [])

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

        $pdf->html_to_pdf_with_template($table_html);

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

            if (isset($header_attributes) && isset($header_attributes[$column])) {

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

        $item_tagname = 'item',

Method name "Export::export_html_to_pdf" is not in camel caps format
Open

    public static function export_html_to_pdf($html, $params = [])

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

            foreach ($printable_data_row as &$printable_data_cell) {

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

        $table_html = self::convert_array_to_html($data, $params);

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

            fwrite($handle, "\t".'<'.$wrapper_tagname.'>'."\n");

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

            fwrite($handle, "\t".'</'.$item_tagname.'>'."\n");

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

            fwrite($handle, '</'.$wrapper_tagname.'>'."\n");

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

            fwrite($handle, '<'.$item_tagname.'>'."\n");

Method name "Export::convert_array_to_html" is not in camel caps format
Open

    public static function convert_array_to_html($data, $params = [])

Missing parameter name
Open

     * @param string Name of file to be given to the user

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

        if (!is_null($wrapper_tagname)) {

Method name "Export::export_table_xls_html" is not in camel caps format
Open

    public static function export_table_xls_html($data, $filename = 'export', $encoding = 'utf-8')

Missing parameter name
Open

     * @param array  Simple array of data to put in XML

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

                $attributes = $header_attributes[$column];

Missing parameter name
Open

     * @param string Name of the root element. A root element should always be given.

Missing parameter name
Open

     * @param string Encoding in which the data is provided

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

        $header_attributes = isset($params['header_attributes']) ? $params['header_attributes'] : [];

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

                $table->setCellContents($row, $column, $printable_data_cell);

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

            if (isset($header_attributes) && isset($header_attributes[$column])) {

The variable $printable_data_cell is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 $wrapper_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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 $wrapper_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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 $item_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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 $printable_data_row is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 $printable_data_row is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 $header_attributes is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 $header_attributes is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 $wrapper_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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 $item_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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 $header_attributes is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 $table_html is not named in camelCase.
Open

    public static function export_table_pdf($data, $params = [])
    {
        $table_html = self::convert_array_to_html($data, $params);
        $params['format'] = isset($params['format']) ? $params['format'] : 'A4';
        $params['orientation'] = isset($params['orientation']) ? $params['orientation'] : 'P';

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 $table_html is not named in camelCase.
Open

    public static function export_table_pdf($data, $params = [])
    {
        $table_html = self::convert_array_to_html($data, $params);
        $params['format'] = isset($params['format']) ? $params['format'] : 'A4';
        $params['orientation'] = isset($params['orientation']) ? $params['orientation'] : 'P';

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 $header_attributes is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 $wrapper_tagname is not named in camelCase.
Open

    public static function arrayToXml(
        $data,
        $filename = 'export',
        $item_tagname = 'item',
        $wrapper_tagname = null,

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 $printable_data_cell is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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 method export_html_to_pdf is not named in camelCase.
Open

    public static function export_html_to_pdf($html, $params = [])
    {
        $params['format'] = isset($params['format']) ? $params['format'] : 'A4';
        $params['orientation'] = isset($params['orientation']) ? $params['orientation'] : 'P';

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

The method convert_array_to_html is not named in camelCase.
Open

    public static function convert_array_to_html($data, $params = [])
    {
        $headers = $data[0];
        unset($data[0]);

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

The method export_table_xls_html is not named in camelCase.
Open

    public static function export_table_xls_html($data, $filename = 'export', $encoding = 'utf-8')
    {
        $file = api_get_path(SYS_ARCHIVE_PATH).uniqid('').'.xls';
        $handle = fopen($file, 'a+');
        $systemEncoding = api_get_system_encoding();

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

The method export_table_pdf is not named in camelCase.
Open

    public static function export_table_pdf($data, $params = [])
    {
        $table_html = self::convert_array_to_html($data, $params);
        $params['format'] = isset($params['format']) ? $params['format'] : 'A4';
        $params['orientation'] = isset($params['orientation']) ? $params['orientation'] : 'P';

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