YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/views/Export.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

Method process has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $viewId = $entityState = false;
        $selectedIds = $request->getArray('selected_ids', 2);
Severity: Minor
Found in modules/Vtiger/views/Export.php - About 1 hr to fix

    Missing class import via use statement (line '25', column '14').
    Open

                throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
    Severity: Minor
    Found in modules/Vtiger/views/Export.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

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

            $viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phpmd

    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 'Users_Privileges_Model' in method 'checkPermission'.
    Open

            $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phpmd

    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 'Import_Module_Model' in method 'process'.
    Open

            $viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($moduleName));
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phpmd

    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\Condition' in method 'process'.
    Open

            $viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phpmd

    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\Export\Records' in method 'process'.
    Open

            $viewer->assign('EXPORT_TYPE', \App\Export\Records::getSupportedFileFormats($moduleName));
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phpmd

    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\Condition' in method 'process'.
    Open

                \App\Condition::validAdvancedConditions($advancedConditions);
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phpmd

    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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('PAGE', $page);
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('SEARCH_KEY', $request->getByType('search_key', 'Alnum'));
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('MODULE', 'Export');
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('EXCLUDED_IDS', $excludedIds);
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('ENTITY_STATE', $entityState);
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('VIEWID', $viewId);
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('EXPORT_TYPE', \App\Export\Records::getSupportedFileFormats($moduleName));
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('OPERATOR', $request->getByType('operator'));
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('SELECTED_IDS', $selectedIds);
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('MODULE_NAME', $moduleName);
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Argument 1 (moduleName) is string but \Import_Module_Model::getListTplForXmlType() takes \type defined at /code/modules/Import/models/Module.php:140
    Open

            $viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($moduleName));
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($moduleName));
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('ADVANCED_CONDITIONS', $advancedConditions);
    Severity: Critical
    Found in modules/Vtiger/views/Export.php by phan

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

    class Vtiger_Export_View extends Vtiger_Index_View

    The class Vtiger_Export_View is not named in CamelCase.
    Open

    class Vtiger_Export_View extends Vtiger_Index_View
    {
        /**
         * Function to check permission.
         *
    Severity: Minor
    Found in modules/Vtiger/views/Export.php by phpmd

    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

        {

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

            $viewId = $entityState = false;

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

            if ($advancedConditions) {

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

            $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

        }

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

        /** {@inheritdoc} */

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

            $selectedIds = $request->getArray('selected_ids', 2);

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

            }

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

            $advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : [];

    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

         * @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('EXCLUDED_IDS', $excludedIds);

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

            $viewer->assign('VIEWID', $viewId);

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

            $viewer->assign('OPERATOR', $request->getByType('operator'));

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

         * Function to check permission.

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

        public function checkPermission(App\Request $request)

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

            $page = $request->getInteger('page');

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

            $viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($moduleName));

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

                \App\Condition::validAdvancedConditions($advancedConditions);

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

                $viewId = $request->getByType('viewname', 2);

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

            $viewer->view('Export.tpl', $moduleName);

    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('MODULE', 'Export');

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

            $viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));

    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', $page);

    Line exceeds 120 characters; contains 211 characters
    Open

            $viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));

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

        /**

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

            if (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Export')) {

    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 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

            $viewer->assign('EXPORT_TYPE', \App\Export\Records::getSupportedFileFormats($moduleName));

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

            $viewer->assign('SEARCH_KEY', $request->getByType('search_key', 'Alnum'));

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

            if (!$request->isEmpty('viewname')) {

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

            if (!$request->isEmpty('entityState')) {

    Line exceeds 120 characters; contains 133 characters
    Open

            $viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));

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

                throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

            $moduleName = $request->getModule();

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

            $viewer->assign('ENTITY_STATE', $entityState);

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

            $viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));

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

            $viewer->assign('SELECTED_IDS', $selectedIds);

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

            $viewer->assign('ADVANCED_CONDITIONS', $advancedConditions);

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

         * @throws \App\Exceptions\NoPermitted

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

            $excludedIds = $request->getArray('excluded_ids', 2);

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

                $entityState = $request->getByType('entityState');

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

            $viewer->assign('MODULE_NAME', $moduleName);

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

    class Vtiger_Export_View extends Vtiger_Index_View

    There are no issues that match your filters.

    Category
    Status