YetiForceCompany/YetiForceCRM

View on GitHub
modules/Calendar/Calendar.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Remove this commented out code.
Open

 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
Severity: Major
Found in modules/Calendar/Calendar.php by sonar-php

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

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

    public $table_index = 'activityid';
Severity: Critical
Found in modules/Calendar/Calendar.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 "date_start" 3 times.
Open

        'Start Date & Time' => 'date_start',
Severity: Critical
Found in modules/Calendar/Calendar.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_activitycf" 3 times.
Open

    public $tab_name = ['vtiger_crmentity', 'vtiger_activity', 'vtiger_activitycf'];
Severity: Critical
Found in modules/Calendar/Calendar.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_activity" 3 times.
Open

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

    public $reminder_table = 'vtiger_activity_reminder';
Severity: Critical
Found in modules/Calendar/Calendar.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.

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

    public $additional_column_fields = ['assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'];
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity

The property $tab_name is not named in camelCase.
Open

class Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 $reminder_table is not named in camelCase.
Open

class Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 $additional_column_fields is not named in camelCase.
Open

class Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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 Calendar extends CRMEntity
{
    public $table_name = 'vtiger_activity';
    public $table_index = 'activityid';
    public $reminder_table = 'vtiger_activity_reminder';
Severity: Minor
Found in modules/Calendar/Calendar.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

     */

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

    public $relationFields = [];

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

    public $default_order_by = 'date_start';

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

    }

Line exceeds 120 characters; contains 124 characters
Open

 * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Activities/Activity.php,v 1.26 2005/03/26 10:42:13 rank Exp $

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

    /**

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

        'End Time' => 'time_end', ];

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

        'Related to' => 'link',

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

        'End Date & Time' => 'due_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

    /** {@inheritdoc} */

Line exceeds 120 characters; contains 178 characters
Open

    public $tab_name_index = ['vtiger_crmentity' => 'crmid', 'vtiger_activity' => 'activityid', 'vtiger_activity_reminder' => 'activity_id', 'vtiger_activitycf' => 'activityid'];

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

    public $additional_column_fields = ['assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'];

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

        'Start Time' => 'time_start',

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

    {

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

    //Added these variables which are used as default order by and sortorder in ListView

Line exceeds 120 characters; contains 146 characters
Open

    public $additional_column_fields = ['assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'];

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

    protected function init(): void

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

        parent::init();

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

        'Start Date & Time' => 'date_start',

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

    public $table_name = 'vtiger_activity';

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

        'Type' => 'activitytype',

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

    public $reminder_table = 'vtiger_activity_reminder';

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

    public $tab_name = ['vtiger_crmentity', 'vtiger_activity', 'vtiger_activitycf'];

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

        'Start Date' => 'date_start',

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

    // This is used to retrieve related vtiger_fields from form posts.

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 $tab_name_index = ['vtiger_crmentity' => 'crmid', 'vtiger_activity' => 'activityid', 'vtiger_activity_reminder' => 'activity_id', 'vtiger_activitycf' => 'activityid'];

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

    public $customFieldTable = ['vtiger_activitycf', 'activityid'];

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

        'Close' => 'status',

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

        $this->tableJoinClause['vtiger_activity_reminder'] = 'LEFT JOIN';

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 = 'activityid';

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

        'Assigned To' => 'assigned_user_id',

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

        'End Date' => 'due_date',

There are no issues that match your filters.

Category
Status