YetiForceCompany/YetiForceCRM

View on GitHub
modules/Services/Services.php

Summary

Maintainability
A
0 mins
Test Coverage
F
13%

The class Services has 17 fields. Consider redesigning Services to keep the number of fields under 15.
Open

class Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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

The method setRelationTables has a boolean flag argument $secmodule, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function setRelationTables($secmodule = false)
Severity: Minor
Found in modules/Services/Services.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

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

            vtlib\Access::setDefaultSharing($ServicesModule);
Severity: Minor
Found in modules/Services/Services.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

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

            $accModuleInstance = vtlib\Module::getInstance('Accounts');
Severity: Minor
Found in modules/Services/Services.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

            $conModuleInstance = vtlib\Module::getInstance('Contacts');
Severity: Minor
Found in modules/Services/Services.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

            $ttModuleInstance = vtlib\Module::getInstance('HelpDesk');
Severity: Minor
Found in modules/Services/Services.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

            $pbModuleInstance = vtlib\Module::getInstance('PriceBooks');
Severity: Minor
Found in modules/Services/Services.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

            $leadModuleInstance = vtlib\Module::getInstance('Leads');
Severity: Minor
Found in modules/Services/Services.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

            $ServicesModule = vtlib\Module::getInstance('Services');
Severity: Minor
Found in modules/Services/Services.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 "serviceid" 6 times.
Open

    public $table_index = 'serviceid';
Severity: Critical
Found in modules/Services/Services.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 "Services" 6 times.
Open

            $ttModuleInstance->setRelatedList($moduleInstance, 'Services', ['select']);
Severity: Critical
Found in modules/Services/Services.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 "unit_price" 3 times.
Open

        'Price' => 'unit_price',
Severity: Critical
Found in modules/Services/Services.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 "service" 3 times.
Open

        'Service No' => ['service' => 'service_no'],
Severity: Critical
Found in modules/Services/Services.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_service" 5 times.
Open

    public $table_name = 'vtiger_service';
Severity: Critical
Found in modules/Services/Services.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_servicecf" 3 times.
Open

    public $customFieldTable = ['vtiger_servicecf', 'serviceid'];
Severity: Critical
Found in modules/Services/Services.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 "servicename" 6 times.
Open

        'Service Name' => 'servicename',
Severity: Critical
Found in modules/Services/Services.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 "select" 5 times.
Open

            $ttModuleInstance->setRelatedList($moduleInstance, 'Services', ['select']);
Severity: Critical
Found in modules/Services/Services.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 \App\Db::createCommand
Open

            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
Severity: Critical
Found in modules/Services/Services.php by phan

Avoid excessively long variable names like $def_detailview_recname. Keep variable name length under 20.
Open

    public $def_detailview_recname = 'servicename';
Severity: Minor
Found in modules/Services/Services.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

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

class Services extends CRMEntity

The property $tab_name_index is not named in camelCase.
Open

class Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 $popup_fields is not named in camelCase.
Open

class Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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_detailview_recname is not named in camelCase.
Open

class Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 Services extends CRMEntity
{
    public $table_name = 'vtiger_service';
    public $table_index = 'serviceid';
    public $column_fields = [];
Severity: Minor
Found in modules/Services/Services.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 $table_name = 'vtiger_service';

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

     */

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

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

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

    /**

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

    /**

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 $def_detailview_recname = 'servicename';

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 setRelationTables($secmodule = false)

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

     * Mandatory table for supporting custom fields.

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

        'Service Name' => ['service' => 'servicename'],

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

        'vtiger_servicecf' => 'serviceid', ];

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

        'No of Units' => 'qty_per_unit',

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 $default_sort_order = 'ASC';

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

        return $relTables[$secmodule];

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

     * Invoked when special actions are performed on the module.

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

            $leadModuleInstance = vtlib\Module::getInstance('Leads');

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

    public $table_index = 'serviceid';

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

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

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

     * @return array returns the array with table names and fieldnames storing relations between module and this module

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

     */

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

    public $customFieldTable = ['vtiger_servicecf', 'serviceid'];

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

        $relTables = [

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

            'Documents' => ['vtiger_senotesrel' => ['crmid', 'notesid'], 'vtiger_service' => 'serviceid'],

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

    {

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

            $pbModuleInstance = vtlib\Module::getInstance('PriceBooks');

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

            $pbModuleInstance->setRelatedList($moduleInstance, 'Services', ['select'], 'getPricebookServices');

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

    public $tab_name = ['vtiger_crmentity', 'vtiger_service', 'vtiger_servicecf'];

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

    // For Popup listview and UI type support

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

            $ttModuleInstance->setRelatedList($moduleInstance, 'Services', ['select']);

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

            $conModuleInstance = vtlib\Module::getInstance('Contacts');

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

            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();

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

        'Service No' => 'service_no',

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

        'Service No' => ['service' => 'service_no'],

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

    public $popup_fields = ['servicename', 'service_usageunit', 'unit_price'];

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

            $ttModuleInstance = vtlib\Module::getInstance('HelpDesk');

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

            $ServicesModule = vtlib\Module::getInstance('Services');

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

            return $relTables;

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 string $moduleName

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

            $accModuleInstance->setRelatedList($moduleInstance, 'Services', ['select']);

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

        'Commission Rate' => 'commissionrate',

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

    // Refers to vtiger_field.fieldname values.

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

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

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

            $moduleInstance->allowSharing();

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

        'Price' => 'unit_price',

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

    public $mandatory_fields = ['servicename', 'assigned_user_id'];

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

     *

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

            vtlib\Access::setDefaultSharing($ServicesModule);

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

    ];

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

            'PriceBooks' => ['vtiger_pricebookproductrel' => ['productid', 'pricebookid'], 'vtiger_service' => 'serviceid'],

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

    /**

Line exceeds 120 characters; contains 131 characters
Open

            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();

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 $def_basicsearch_col = 'servicename';

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

            // Initialize module sequence for the module

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

        // tablename should not have prefix 'vtiger_'

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

    ];

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

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

            $accModuleInstance = vtlib\Module::getInstance('Accounts');

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

            // Mark the module as Standard module

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

    public $default_order_by = '';

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

     * @param bool|string $secmodule secondary module name

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

            $conModuleInstance->setRelatedList($moduleInstance, 'Services', ['select']);

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

        'vtiger_service' => 'serviceid',

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

     * Function to get the relation tables for related modules.

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

     * @param string $eventType

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

            $leadModuleInstance->setRelatedList($moduleInstance, 'Services', ['select']);

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

        }

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

        'Service Name' => 'servicename',

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

        'Price' => ['service' => 'unit_price'],

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

    // Column value to use on detail view record text display

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

     *

Line exceeds 120 characters; contains 124 characters
Open

            'PriceBooks' => ['vtiger_pricebookproductrel' => ['productid', 'pricebookid'], 'vtiger_service' => 'serviceid'],

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

        if (false === $secmodule) {

The variable $ServicesModule is not named in camelCase.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            $moduleInstance = vtlib\Module::getInstance($moduleName);
            $moduleInstance->allowSharing();
Severity: Minor
Found in modules/Services/Services.php by phpmd

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

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            $moduleInstance = vtlib\Module::getInstance($moduleName);
            $moduleInstance->allowSharing();
Severity: Minor
Found in modules/Services/Services.php by phpmd

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

There are no issues that match your filters.

Category
Status