YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Log/views/LogsViewer.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using undefined variables such as '$logsViewerColumnMapping' which will lead to PHP notices.
Open

        $viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('TYPE', $type);
Severity: Critical
Found in modules/Settings/Log/views/LogsViewer.php by phan

Reference to static property logsViewerColumnMapping from undeclared class \App\Log
Open

        $viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);
Severity: Critical
Found in modules/Settings/Log/views/LogsViewer.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);
Severity: Critical
Found in modules/Settings/Log/views/LogsViewer.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Settings_Log_LogsViewer_View extends Settings_Vtiger_Index_View

The class Settings_Log_LogsViewer_View is not named in CamelCase.
Open

class Settings_Log_LogsViewer_View extends Settings_Vtiger_Index_View
{
    /**
     * Function gets module settings.
     *

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Spaces must be used to indent lines; tabs are not allowed
Open

    public function process(App\Request $request)

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function gets module settings.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->view('LogsViewer.tpl', $request->getModule(false));

Spaces must be used to indent lines; tabs are not allowed
Open

        $type = $request->has('type') ? $request->getByType('type', 'Text') : 'magento';

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer = $this->getViewer($request);

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('TYPE', $type);

Class name "Settings_Log_LogsViewer_View" is not in camel caps format
Open

class Settings_Log_LogsViewer_View extends Settings_Vtiger_Index_View

There are no issues that match your filters.

Category
Status