YetiForceCompany/YetiForceCRM

View on GitHub
modules/ModComments/ModComments.php

Summary

Maintainability
C
1 day
Test Coverage
F
12%

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

    public static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
    {
        if (empty($moduleNames)) {
            return;
        }
Severity: Minor
Found in modules/ModComments/ModComments.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

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

    public static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
    {
        if (empty($moduleNames)) {
            return;
        }
Severity: Minor
Found in modules/ModComments/ModComments.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

Missing class import via use statement (line '60', column '15').
Open

            return new ModComments_DetailViewBlockCommentWidget();
Severity: Minor
Found in modules/ModComments/ModComments.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

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

        return new ModComments_CommentsModel($this->column_fields);
Severity: Minor
Found in modules/ModComments/ModComments.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

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

            $modCommentsModule = vtlib\Module::getInstance('ModComments');
Severity: Minor
Found in modules/ModComments/ModComments.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 'removeWidgetFrom'.
Open

            $modCommentsModule = vtlib\Module::getInstance('ModComments');
Severity: Minor
Found in modules/ModComments/ModComments.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 'addWidgetTo'.
Open

            $module = vtlib\Module::getInstance($moduleName);
Severity: Minor
Found in modules/ModComments/ModComments.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\App\Cache' in method 'addWidgetTo'.
Open

            \App\Cache::delete('isModuleCommentEnabled', $moduleName);
Severity: Minor
Found in modules/ModComments/ModComments.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\Field' in method 'addWidgetTo'.
Open

            $modCommentsRelatedToField = vtlib\Field::getInstance('related_to', $modCommentsModule);
Severity: Minor
Found in modules/ModComments/ModComments.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 'removeWidgetFrom'.
Open

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

            $modCommentsRelatedToField = vtlib\Field::getInstance('related_to', $modCommentsModule);
Severity: Minor
Found in modules/ModComments/ModComments.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\App\Cache' in method 'removeWidgetFrom'.
Open

            \App\Cache::delete('isModuleCommentEnabled', $moduleName);
Severity: Minor
Found in modules/ModComments/ModComments.php by phpmd

StaticAccess

Since: 1.4.0

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

Example

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

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

Avoid using static access to class '\App\Privilege' in method 'getWidget'.
Open

            \App\Privilege::isPermitted('ModComments', 'DetailView')) {
Severity: Minor
Found in modules/ModComments/ModComments.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 "ModComments" 3 times.
Open

            \App\Privilege::isPermitted('ModComments', 'DetailView')) {
Severity: Critical
Found in modules/ModComments/ModComments.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 "related_to" 4 times.
Open

        \App\Db::getInstance()->createCommand()->update('vtiger_modcomments', ['related_to' => $targetParentId], ['related_to' => $currentParentId])->execute();
Severity: Critical
Found in modules/ModComments/ModComments.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 "DetailViewBlockCommentWidget" 3 times.
Open

        if ('DetailViewBlockCommentWidget' === $name &&
Severity: Critical
Found in modules/ModComments/ModComments.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/ModComments/ModComments.php by phan

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

        \App\Db::getInstance()->createCommand()->update('vtiger_modcomments', ['related_to' => $targetParentId], ['related_to' => $currentParentId])->execute();
Severity: Critical
Found in modules/ModComments/ModComments.php by phan

Cannot access internal method \vtlib\Field::setRelatedModules() of namespace \vtlib defined at /code/vtlib/Vtiger/Field.php:145 from namespace \
Open

            $modCommentsRelatedToField->setRelatedModules($commentWidgetModules);
Severity: Minor
Found in modules/ModComments/ModComments.php by phan

Call to method __construct from undeclared class \ModComments_DetailViewBlockCommentWidget
Open

            return new ModComments_DetailViewBlockCommentWidget();
Severity: Critical
Found in modules/ModComments/ModComments.php by phan

Returning type \ModComments_DetailViewBlockCommentWidget but getWidget() is declared to return bool
Open

            return new ModComments_DetailViewBlockCommentWidget();
Severity: Minor
Found in modules/ModComments/ModComments.php by phan

Reference to undeclared property \ModComments->column_fields
Open

        return new ModComments_CommentsModel($this->column_fields);
Severity: Minor
Found in modules/ModComments/ModComments.php by phan

Argument 1 (moduleNames) is array{0:'Leads',1:'Contacts',2:'Accounts',3:'Project',4:'ProjectTask'} but \ModComments::addWidgetTo() takes string defined at /code/modules/ModComments/ModComments.php:72
Open

            self::addWidgetTo(['Leads', 'Contacts', 'Accounts', 'Project', 'ProjectTask']);
Severity: Minor
Found in modules/ModComments/ModComments.php by phan

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
    {
        if (empty($moduleNames)) {
            return;
        }
Severity: Major
Found in modules/ModComments/ModComments.php and 1 other location - About 4 hrs to fix
modules/ModComments/ModComments.php on lines 105..129

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 177.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
    {
        if (empty($moduleNames)) {
            return;
        }
Severity: Major
Found in modules/ModComments/ModComments.php and 1 other location - About 4 hrs to fix
modules/ModComments/ModComments.php on lines 72..96

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 177.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            $modCommentsRelatedToField = vtlib\Field::getInstance('related_to', $modCommentsModule);
Severity: Minor
Found in modules/ModComments/ModComments.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

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

            $modCommentsRelatedToField = vtlib\Field::getInstance('related_to', $modCommentsModule);
Severity: Minor
Found in modules/ModComments/ModComments.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 ModComments extends ModCommentsCore

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 18 and the first side effect is on line 10.
Open

<?php

The 'getWidget()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public static function getWidget($name)
    {
        if ('DetailViewBlockCommentWidget' === $name &&
            \App\Privilege::isPermitted('ModComments', 'DetailView')) {
            require_once __DIR__ . '/Detail/Widget/DetailViewBlockComment.php';
Severity: Minor
Found in modules/ModComments/ModComments.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

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

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

     * @param string $moduleName Module name

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

        parent::moduleHandler($moduleName, $eventType);

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;

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

     * @param string $widgetName

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

            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->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

            return;

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

            if ($module) {

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

            $modCommentsRelatedToField = vtlib\Field::getInstance('related_to', $modCommentsModule);

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

     */

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

     *

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

     * @param int $currentParentId Source parent record id

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

     * @param int $targetParentId  Target parent record id

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

    public static function getWidget($name)

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

            require_once __DIR__ . '/Detail/Widget/DetailViewBlockComment.php';

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

        $commentWidgetModules = [];

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

        if (\count($commentWidgetModules) > 0) {

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

     * @param string $eventType  Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)

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

        if (empty($moduleNames)) {

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

     * Remove widget from other modules.

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

     */

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

            $moduleNames = [$moduleNames];

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

     * @param string $moduleNames

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

        foreach ($moduleNames as $moduleName) {

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

                $commentWidgetModules[] = $moduleName;

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

     * @param string $moduleNames

Line exceeds 120 characters; contains 121 characters
Open

                $module->deleteLink($widgetType, $widgetName, 'block://ModComments:modules/ModComments/ModComments.php');

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

        if (\count($commentWidgetModules) > 0) {

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

            $modCommentsModule = vtlib\Module::getInstance('ModComments');

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 static function transferRecords($currentParentId, $targetParentId)

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

        \App\Db::getInstance()->createCommand()->update('vtiger_modcomments', ['related_to' => $targetParentId], ['related_to' => $currentParentId])->execute();

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

     * Get widget instance by name.

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

                $commentWidgetModules[] = $moduleName;

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

     * Add widget to other 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

            $modCommentsModule = vtlib\Module::getInstance('ModComments');

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 getAsCommentModel()

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

    }

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

     *

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

            return new ModComments_DetailViewBlockCommentWidget();

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

            \App\Cache::delete('isModuleCommentEnabled', $moduleName);

Line exceeds 120 characters; contains 137 characters
Open

    public static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')

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

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

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

                $module->addLink($widgetType, $widgetName, 'block://ModComments:modules/ModComments/ModComments.php');

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

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

     * @param string $name

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

            \App\Privilege::isPermitted('ModComments', 'DetailView')) {

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

        return false;

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

    public static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')

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

     * Wrap this instance as a model.

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

        return new ModComments_CommentsModel($this->column_fields);

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

     *

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

        }

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

            $modCommentsRelatedToField->setRelatedModules($commentWidgetModules);

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

     * @param string $widgetType

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

            self::addWidgetTo(['Leads', 'Contacts', 'Accounts', 'Project', 'ProjectTask']);

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 bool

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

     * @param string $widgetName

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

        if (\is_string($moduleNames)) {

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

            $modCommentsRelatedToField = vtlib\Field::getInstance('related_to', $modCommentsModule);

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

        if (empty($moduleNames)) {

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

     *

Line exceeds 120 characters; contains 160 characters
Open

        \App\Db::getInstance()->createCommand()->update('vtiger_modcomments', ['related_to' => $targetParentId], ['related_to' => $currentParentId])->execute();

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

     */

Line exceeds 120 characters; contains 132 characters
Open

    public static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')

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

            $moduleNames = [$moduleNames];

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

    public static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')

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

    {

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

     * Transfer the comment records from one parent record to another.

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 ('DetailViewBlockCommentWidget' === $name &&

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

     * @param string $widgetType

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

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

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

        $commentWidgetModules = [];

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

                $module->deleteLink($widgetType, $widgetName, 'block://ModComments:modules/ModComments/ModComments.php');

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

            $modCommentsRelatedToField->unsetRelatedModules($commentWidgetModules);

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

        if (\is_string($moduleNames)) {

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

            \App\Cache::delete('isModuleCommentEnabled', $moduleName);

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

    /**

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

        foreach ($moduleNames as $moduleName) {

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

        }

There are no issues that match your filters.

Category
Status