YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Inventory/views/DiscountConfiguration.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Log' in method 'process'.
Open

        \App\Log::trace('End ' . __METHOD__);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class '\App\Log' in method 'process'.
Open

        \App\Log::trace('Start ' . __METHOD__);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid using static access to class 'Settings_Inventory_Module_Model' in method 'process'.
Open

        $config = Settings_Inventory_Module_Model::getConfig($view);

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid unused parameters such as '$request'.
Open

    public function getPageLabels(App\Request $request)

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

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('VIEW', $view);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('QUALIFIED_MODULE', $qualifiedModule);

Call to method trace from undeclared class \App\Log
Open

        \App\Log::trace('End ' . __METHOD__);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('CONFIG', $config);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('PAGE_LABELS', $this->getPageLabels($request));

Call to method trace from undeclared class \App\Log
Open

        \App\Log::trace('Start ' . __METHOD__);

Avoid excessively long class names like Settings_Inventory_DiscountConfiguration_View. Keep class name length under 40.
Open

class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View
{
    public function getView()
    {
        return 'DiscountConfiguration';

LongClassName

Since: 2.9

Detects when classes or interfaces are declared with excessively long names.

Example

class ATooLongClassNameThatHintsAtADesignProblem {

}

interface ATooLongInterfaceNameThatHintsAtADesignProblem {

}

Source https://phpmd.org/rules/naming.html#longclassname

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

class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View

The class Settings_Inventory_DiscountConfiguration_View is not named in CamelCase.
Open

class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View
{
    public function getView()
    {
        return 'DiscountConfiguration';

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

    /**

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

    public function getPageLabels(App\Request $request)

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

        $view = $this->getView();

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

        $viewer->assign('CONFIG', $config);

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

        $translations = [];

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

        $qualifiedModule = $request->getModule(false);

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

        $viewer->view('Config.tpl', $qualifiedModule);

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

        \App\Log::trace('End ' . __METHOD__);

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

    {

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

        $view = $this->getView();

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

        $translations['title_single'] = 'LBL_' . strtoupper($view) . '_SINGLE';

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

     * Process.

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('PAGE_LABELS', $this->getPageLabels($request));

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

        $viewer->assign('VIEW', $view);

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

    public function getView()

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

        $viewer->assign('QUALIFIED_MODULE', $qualifiedModule);

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

        $config = Settings_Inventory_Module_Model::getConfig($view);

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

        $translations['title'] = 'LBL_' . strtoupper($view);

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

    public function getFooterScripts(App\Request $request)

Line exceeds 120 characters; contains 165 characters
Open

        return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['modules.Settings.' . $request->getModule() . '.resources.Config']));

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

     */

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

        \App\Log::trace('Start ' . __METHOD__);

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

        return $translations;

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

    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

        $translations['description'] = 'LBL_' . strtoupper($view) . '_DESCRIPTION';

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

        return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['modules.Settings.' . $request->getModule() . '.resources.Config']));

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

    }

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

        return 'DiscountConfiguration';

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

     *

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

    }

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

class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View

There are no issues that match your filters.

Category
Status