YetiForceCompany/YetiForceCRM

View on GitHub
modules/OSSMailView/OSSMailView.php

Summary

Maintainability
A
1 hr
Test Coverage
F
45%

The class OSSMailView has 18 fields. Consider redesigning OSSMailView to keep the number of fields under 15.
Open

class OSSMailView extends CRMEntity
{
    public $table_name = 'vtiger_ossmailview';
    public $table_index = 'ossmailviewid';
    public $column_fields = [];
Severity: Minor
Found in modules/OSSMailView/OSSMailView.php by phpmd

TooManyFields

Since: 0.1

Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

Example

class Person {
   protected $one;
   private $two;
   private $three;
   [... many more fields ...]
}

Source https://phpmd.org/rules/codesize.html#toomanyfields

Method moduleHandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        $dbCommand = App\Db::getInstance()->createCommand();
        if ('module.postinstall' === $eventType) {
            $displayLabel = 'OSSMailView';
Severity: Minor
Found in modules/OSSMailView/OSSMailView.php - About 1 hr to fix

    Function moduleHandler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function moduleHandler($moduleName, $eventType)
        {
            $dbCommand = App\Db::getInstance()->createCommand();
            if ('module.postinstall' === $eventType) {
                $displayLabel = 'OSSMailView';
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Avoid using static access to class '\App\Module' in method 'moduleHandler'.
    Open

                CRMEntity::getInstance('ModTracker')->enableTrackingForModule(\App\Module::getModuleId($moduleName));
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.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 'Settings_Vtiger_Menu_Model' in method 'moduleHandler'.
    Open

                Settings_Vtiger_Menu_Model::clearCache();
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.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 'vtlib\Module' in method 'moduleHandler'.
    Open

                $module = vtlib\Module::getInstance($moduleName);
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.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

    The method moduleHandler uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $dbCommand->delete('vtiger_settings_field', ['name' => $displayLabel])->execute();
                Settings_Vtiger_Menu_Model::clearCache();
            }
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.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

    Avoid using static access to class 'vtlib\Module' in method 'moduleHandler'.
    Open

                $module = vtlib\Module::getInstance($moduleName);
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.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 'Settings_Vtiger_Module_Model' in method 'moduleHandler'.
    Open

                Settings_Vtiger_Module_Model::addSettingsField('LBL_MAIL_TOOLS', [
                    'name' => $displayLabel,
                    'iconpath' => 'adminIcon-oss_mailview',
                    'description' => 'LBL_MAIL_VIEW_DESCRIPTION',
                    'linkto' => 'index.php?module=OSSMailView&parent=Settings&view=index',
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.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

    Define a constant instead of duplicating this literal "vtiger_ossmailscanner_config" 3 times.
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'widget_limit', 'value' => '10'])->execute();
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "ossmailview_sendtype" 3 times.
    Open

            'SendType' => 'ossmailview_sendtype',
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "value" 3 times.
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'widget_limit', 'value' => '10'])->execute();
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "conf_type" 3 times.
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'widget_limit', 'value' => '10'])->execute();
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "parameter" 3 times.
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'widget_limit', 'value' => '10'])->execute();
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "email_list" 3 times.
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'widget_limit', 'value' => '10'])->execute();
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "ossmailviewid" 6 times.
    Open

        public $table_index = 'ossmailviewid';
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "vtiger_ossmailviewcf" 4 times.
    Open

        public $customFieldTable = ['vtiger_ossmailviewcf', 'ossmailviewid'];
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "subject" 5 times.
    Open

            'Subject' => 'subject',
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "vtiger_ossmailview" 4 times.
    Open

        public $table_name = 'vtiger_ossmailview';
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Define a constant instead of duplicating this literal "ossmailview" 6 times.
    Open

            'number' => ['ossmailview' => 'ossmailview_no'],
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by sonar-php

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

    Call to undeclared method \CRMEntity::enableTrackingForModule
    Open

                CRMEntity::getInstance('ModTracker')->enableTrackingForModule(\App\Module::getModuleId($moduleName));
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                $userName = \App\User::getCurrentUserModel()->getDetail('user_name');
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                $userName = \App\User::getCurrentUserModel()->getDetail('user_name');
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

            $dbCommand = App\Db::getInstance()->createCommand();
    Severity: Critical
    Found in modules/OSSMailView/OSSMailView.php by phan

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

    class OSSMailView extends CRMEntity

    The property $popup_fields is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $search_fields is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $tab_name_index is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $tab_name is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $related_tables is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $list_fields_name is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $def_basicsearch_col is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $column_fields is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $default_sort_order is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $table_name is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $default_order_by is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $table_index is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $search_fields_name is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $mandatory_fields is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $special_functions is not named in camelCase.
    Open

    class OSSMailView extends CRMEntity
    {
        public $table_name = 'vtiger_ossmailview';
        public $table_index = 'ossmailviewid';
        public $column_fields = [];
    Severity: Minor
    Found in modules/OSSMailView/OSSMailView.php by phpmd

    CamelCasePropertyName

    Since: 0.2

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

    Example

    class ClassName {
        protected $property_name;
    }

    Source

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

        public $customFieldTable = ['vtiger_ossmailviewcf', 'ossmailviewid'];

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

         * Mandatory table for supporting custom fields.

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

        public $table_name = 'vtiger_ossmailview';

    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

            if ('module.postinstall' === $eventType) {

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

                $module = vtlib\Module::getInstance($moduleName);

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

                    'linkto' => 'index.php?module=OSSMailView&parent=Settings&view=index',

    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

            'To' => 'to_email',

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

        /**

    Line exceeds 120 characters; contains 153 characters
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'widget_limit', 'value' => '10'])->execute();

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

                    'iconpath' => 'adminIcon-oss_mailview',

    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 $table_index = 'ossmailviewid';

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

        public $IsCustomModule = true;

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

            // Format: Field Label => fieldname

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

         */

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

            'Assigned To' => ['ossmailview' => 'assigned_user_id'],

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

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'permissions', 'value' => 'vtiger'])->execute();

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

            $displayLabel = 'Mail View';

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

         * Mandatory for Saving, Include tablename and tablekey columnname here.

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

        public $default_order_by = 'date';

    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

                $dbCommand->update('vtiger_tab', ['customized' => 0], ['name' => $displayLabel])->execute();

    Line exceeds 120 characters; contains 156 characters
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'permissions', 'value' => 'vtiger'])->execute();

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

            } elseif ('module.postupdate' === $eventType) {

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

                $dbCommand->delete('vtiger_settings_field', ['name' => $displayLabel])->execute();

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

        }

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

         * Mandatory for Saving, Include tables related to this module.

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

        public $relationFields = [];

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

            'Subject' => ['ossmailview' => 'subject'],

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

            'To' => ['ossmailview' => 'to_email'],

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

            'SendType' => ['ossmailview' => 'ossmailview_sendtype'],

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

        // For Popup window record selection

    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 $search_fields = [

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

            // Format: Field Label => Array(tablename, columnname)

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

            'From' => ['ossmailview' => 'from_email'],

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

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'widget_limit', 'value' => '10'])->execute();

    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 $related_tables = ['vtiger_ossmailviewcf' => ['ossmailviewid', 'vtiger_ossmailview', 'ossmailviewid']];

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

        public $tab_name_index = [

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

            'vtiger_crmentity' => 'crmid',

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

        public $popup_fields = ['from', 'subject', 'ossmailview_sendtype'];

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

                $dbCommand->insert('vtiger_ossmails_logs', ['action' => 'Action_UpdateModule', 'info' => $moduleName . ' ' . $module->version, 'user' => $userName, 'start_time' => date('Y-m-d H:i:s')])->execute();

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

                    'name' => $displayLabel,

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

            'Assigned To' => 'assigned_user_id',

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

            'number' => ['ossmailview' => 'ossmailview_no'],

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

        public $search_fields_name = [];

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

        public $special_functions = ['set_import_assigned_user'];

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

                $module = vtlib\Module::getInstance($moduleName);

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

            if ($registerLink) {

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

                $registerLink = false;

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

            } elseif ('module.enabled' === $eventType) {

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

                Settings_Vtiger_Module_Model::addSettingsField('LBL_MAIL_TOOLS', [

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

                Settings_Vtiger_Menu_Model::clearCache();

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

        /**

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

            'Subject' => 'subject',

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

            // tablename should not have prefix 'vtiger_'

    Line exceeds 120 characters; contains 209 characters
    Open

                $dbCommand->insert('vtiger_ossmails_logs', ['action' => 'Action_UpdateModule', 'info' => $moduleName . ' ' . $module->version, 'user' => $userName, 'start_time' => date('Y-m-d H:i:s')])->execute();

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

        public $list_fields_name = [

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

        // For Alphabetical search

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

        // Used when enabling/disabling the mandatory fields for the module.

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

            'vtiger_ossmailviewcf' => 'ossmailviewid', ];

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

            'SendType' => 'ossmailview_sendtype',

    Line exceeds 120 characters; contains 151 characters
    Open

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'target', 'value' => '_blank'])->execute();

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

                $userName = \App\User::getCurrentUserModel()->getDetail('user_name');

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

                $registerLink = true;

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

         */

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

        // Refers to vtiger_field.fieldname values.

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

        public $default_sort_order = 'DESC';

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

        public function moduleHandler($moduleName, $eventType)

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

            $dbCommand = App\Db::getInstance()->createCommand();

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

            } elseif ('module.disabled' === $eventType) {

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

         * @var string[] List of fields in the RelationListView

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

        public $def_basicsearch_col = 'subject';

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

                CRMEntity::getInstance('ModTracker')->enableTrackingForModule(\App\Module::getModuleId($moduleName));

    Line exceeds 120 characters; contains 173 characters
    Open

                $dbCommand->insert('vtiger_ossmails_logs', ['action' => 'Action_InstallModule', 'info' => $moduleName . ' ' . $module->version, 'user' => $userName])->execute();

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

                    'description' => 'LBL_MAIL_VIEW_DESCRIPTION',

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

            'From' => 'from_email',

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

        // For Popup listview and UI type support

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

        ];

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

                $displayLabel = 'OSSMailView';

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

                $registerLink = true;

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

        public $column_fields = [];

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

        /** Indicator if this is a custom module or standard module */

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

        public $tab_name = ['vtiger_crmentity', 'vtiger_ossmailview', 'vtiger_ossmailviewcf'];

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

            'vtiger_ossmailview' => 'ossmailviewid',

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

            'number' => 'ossmailview_no',

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

        public $mandatory_fields = ['subject', 'from'];

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

        // Callback function list during Importing

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

        {

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

                $dbCommand->insert('vtiger_ossmailscanner_config', ['conf_type' => 'email_list', 'parameter' => 'target', 'value' => '_blank'])->execute();

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

                $dbCommand->insert('vtiger_ossmails_logs', ['action' => 'Action_InstallModule', 'info' => $moduleName . ' ' . $module->version, 'user' => $userName])->execute();

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

                $userName = \App\User::getCurrentUserModel()->getDetail('user_name');

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

            }

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

            } else {

    There are no issues that match your filters.

    Category
    Status