YetiForceCompany/YetiForceCRM

View on GitHub
modules/Documents/models/Module.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
7%

Method getSettingLinks has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getSettingLinks(): array
    {
        Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
        $settingsLinks = [];
        if (\App\Security\AdminAccess::isPermitted('Workflows') && VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
Severity: Minor
Found in modules/Documents/models/Module.php - About 1 hr to fix

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

        public function getModalRecordsListFields(App\QueryGenerator $queryGenerator, $sourceModule = false)
        {
            $popupFields = parent::getModalRecordsListFields($queryGenerator, $sourceModule);
            $headerFields = $queryGenerator->getListViewFields();
            foreach (['filestatus', 'filesize', 'filelocationtype'] as $fieldName) {
    Severity: Minor
    Found in modules/Documents/models/Module.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 getSettingLinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getSettingLinks(): array
        {
            Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
            $settingsLinks = [];
            if (\App\Security\AdminAccess::isPermitted('Workflows') && VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
    Severity: Minor
    Found in modules/Documents/models/Module.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 '48', column '44').
    Open

                ['not in', 'vtiger_notes.notesid', (new App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $record])],
    Severity: Minor
    Found in modules/Documents/models/Module.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

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

        public function getModalRecordsListFields(App\QueryGenerator $queryGenerator, $sourceModule = false)
    Severity: Minor
    Found in modules/Documents/models/Module.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

    Missing class import via use statement (line '124', column '22').
    Open

            $templateId = (new \App\Db\Query())->select(['vtiger_field.fieldparams'])
    Severity: Minor
    Found in modules/Documents/models/Module.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 '129', column '15').
    Open

            return (new \App\Db\Query())
    Severity: Minor
    Found in modules/Documents/models/Module.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getCustomLinkLabel'.
    Open

                $href = \App\Purifier::encodeHtml($recordModel->get('filename'));
    Severity: Minor
    Found in modules/Documents/models/Module.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 '\Vtiger_Record_Model' in method 'getCustomLinkLabel'.
    Open

            $recordModel = \Vtiger_Record_Model::getInstanceById($id, $this->getName());
    Severity: Minor
    Found in modules/Documents/models/Module.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 assigning values to variables in if clauses and the like (line '141', column '57').
    Open

        public function getCustomLinkLabel(int $id, string $label): string
        {
            $recordModel = \Vtiger_Record_Model::getInstanceById($id, $this->getName());
            $link = '';
            if ('I' === $recordModel->get('filelocationtype') && ($href = $recordModel->getDownloadFileURL())) {
    Severity: Minor
    Found in modules/Documents/models/Module.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

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

    Avoid using static access to class 'VTWorkflowUtils' in method 'getSettingLinks'.
    Open

            if (\App\Security\AdminAccess::isPermitted('Workflows') && VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
    Severity: Minor
    Found in modules/Documents/models/Module.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\Purifier' in method 'getCustomLinkLabel'.
    Open

            return \App\Purifier::encodeHtml($label) . $link;
    Severity: Minor
    Found in modules/Documents/models/Module.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 'Vtiger_Loader' in method 'getSettingLinks'.
    Open

            Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.php');
    Severity: Minor
    Found in modules/Documents/models/Module.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\Security\AdminAccess' in method 'getSettingLinks'.
    Open

            if (\App\Security\AdminAccess::isPermitted('Workflows') && VTWorkflowUtils::checkModuleWorkflow($this->getName())) {
    Severity: Minor
    Found in modules/Documents/models/Module.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\Security\AdminAccess' in method 'getSettingLinks'.
    Open

            if (\App\Security\AdminAccess::isPermitted('Picklist')) {
    Severity: Minor
    Found in modules/Documents/models/Module.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\Security\AdminAccess' in method 'getSettingLinks'.
    Open

            if (\App\Security\AdminAccess::isPermitted('RecordNumbering') && $this->hasSequenceNumberField()) {
    Severity: Minor
    Found in modules/Documents/models/Module.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\Security\AdminAccess' in method 'getSettingLinks'.
    Open

            if (\App\Security\AdminAccess::isPermitted('LayoutEditor')) {
    Severity: Minor
    Found in modules/Documents/models/Module.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\Language' in method 'getCustomLinkLabel'.
    Open

                $title = App\Language::translate('LBL_DOWNLOAD_FILE', 'Documents');
    Severity: Minor
    Found in modules/Documents/models/Module.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 "linkicon" 4 times.
    Open

                    'linkicon' => 'yfi yfi-workflows-2',
    Severity: Critical
    Found in modules/Documents/models/Module.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 "LISTVIEWSETTING" 4 times.
    Open

                    'linktype' => 'LISTVIEWSETTING',
    Severity: Critical
    Found in modules/Documents/models/Module.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 "linktype" 4 times.
    Open

                    'linktype' => 'LISTVIEWSETTING',
    Severity: Critical
    Found in modules/Documents/models/Module.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 "linkurl" 4 times.
    Open

                    'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(),
    Severity: Critical
    Found in modules/Documents/models/Module.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 "linklabel" 4 times.
    Open

                    'linklabel' => 'LBL_EDIT_WORKFLOWS',
    Severity: Critical
    Found in modules/Documents/models/Module.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 unused parameters such as '$field'.
    Open

        public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
    Severity: Minor
    Found in modules/Documents/models/Module.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

    Avoid unused parameters such as '$sourceModule'.
    Open

        public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
    Severity: Minor
    Found in modules/Documents/models/Module.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

    Parameter $queryGenerator has undeclared type \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

        public function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)
    Severity: Minor
    Found in modules/Documents/models/Module.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

                ['not in', 'vtiger_notes.notesid', (new App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $record])],
    Severity: Critical
    Found in modules/Documents/models/Module.php by phan

    Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->addNativeCondition(['and',
    Severity: Critical
    Found in modules/Documents/models/Module.php by phan

    Parameter $queryGenerator has undeclared type \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

        public function getModalRecordsListFields(App\QueryGenerator $queryGenerator, $sourceModule = false)
    Severity: Minor
    Found in modules/Documents/models/Module.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

            return (new \App\Db\Query())
    Severity: Critical
    Found in modules/Documents/models/Module.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

            $templateId = (new \App\Db\Query())->select(['vtiger_field.fieldparams'])
    Severity: Critical
    Found in modules/Documents/models/Module.php by phan

    Call to method setField from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

                        $queryGenerator->setField($fieldName);
    Severity: Critical
    Found in modules/Documents/models/Module.php by phan

    Call to method getListViewFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $headerFields = $queryGenerator->getListViewFields();
    Severity: Critical
    Found in modules/Documents/models/Module.php by phan

    Call to undeclared method \Vtiger_Record_Model::getDownloadFileURL
    Open

            if ('I' === $recordModel->get('filelocationtype') && ($href = $recordModel->getDownloadFileURL())) {
    Severity: Critical
    Found in modules/Documents/models/Module.php by phan

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

    class Documents_Module_Model extends Vtiger_Module_Model

    The class Documents_Module_Model is not named in CamelCase.
    Open

    class Documents_Module_Model extends Vtiger_Module_Model
    {
        /** {@inheritdoc} */
        public $allowTypeChange = false;
    
    
    Severity: Minor
    Found in modules/Documents/models/Module.php by phpmd

    CamelCaseClassName

    Since: 0.2

    It is considered best practice to use the CamelCase notation to name classes.

    Example

    class class_name {
    }

    Source

    Avoid variables with short names like $id. Configured minimum length is 3.
    Open

        public function getCustomLinkLabel(int $id, string $label): string
    Severity: Minor
    Found in modules/Documents/models/Module.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

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

        public $allowTypeChange = false;

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

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

         * @param string              $field          parent fieldname

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

            foreach (['filestatus', 'filesize', 'filelocationtype'] as $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

                    'linklabel' => 'LBL_EDIT_FIELDS',

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

                ];

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

                ->select(['tree', 'name'])

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

         * Functions tells if the module supports workflow.

    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

            if (\App\Security\AdminAccess::isPermitted('LayoutEditor')) {

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

                    'linktype' => 'LISTVIEWSETTING',

    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 (!isset($headerFields[$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

                    'linkicon' => 'adminIcon-fields-picklists',

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

         * Added function that returns the folders in a Document.

    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              $record         parent 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

            }

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

        }

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

            $settingsLinks = [];

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

                    'linktype' => 'LISTVIEWSETTING',

    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

                $settingsLinks[] = [

    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 $settingsLinks;

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

                ->where(['vtiger_field.columnname' => 'folderid', 'vtiger_field.tablename' => 'vtiger_notes'])

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

                $link = "<a href=\"{$href}\" title=\"{$href}\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"fa-solid fa-link ml-1\"></span></a>";

    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

        public function isSummaryViewSupported()

    Line exceeds 120 characters; contains 146 characters
    Open

                ['not in', 'vtiger_notes.notesid', (new App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $record])],

    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

                    'linkicon' => 'yfi yfi-workflows-2',

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

                ->from('vtiger_field')

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

            $recordModel = \Vtiger_Record_Model::getInstanceById($id, $this->getName());

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

            } elseif ($recordModel->get('filename')) {

    Line exceeds 120 characters; contains 156 characters
    Open

                $link = "<a href=\"{$href}\" title=\"{$href}\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"fa-solid fa-link ml-1\"></span></a>";

    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 function getQueryByModuleField($sourceModule, $field, $record, App\QueryGenerator $queryGenerator)

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

            if (\App\Security\AdminAccess::isPermitted('Workflows') && VTWorkflowUtils::checkModuleWorkflow($this->getName())) {

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

                $settingsLinks[] = [

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

                    'linktype' => 'LISTVIEWSETTING',

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

            if (\App\Security\AdminAccess::isPermitted('Picklist')) {

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

                    'linktype' => 'LISTVIEWSETTING',

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

                    'linkurl' => 'index.php?parent=Settings&module=RecordNumbering&view=CustomRecordNumbering&sourceModule=' . $this->getName(),

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

        }

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

         * Function to get list view query for popup window.

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

         * @param \App\QueryGenerator $queryGenerator

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

        }

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

        /** {@inheritdoc} */

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

                }

    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

        /** {@inheritdoc} */

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

                $href = \App\Purifier::encodeHtml($recordModel->get('filename'));

    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

            return true;

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

            return $popupFields;

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

        public function getSettingLinks(): array

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

                $settingsLinks[] = [

    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 function getCustomLinkLabel(int $id, string $label): string

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

            $link = '';

    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

                    'linkurl' => 'index.php?parent=Settings&module=Workflows&view=List&sourceModule=' . $this->getName(),

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

                ->where(['templateid' => $templateId])

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

            return \App\Purifier::encodeHtml($label) . $link;

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

         * @param string              $sourceModule   Parent module

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

                    'linkurl' => 'index.php?parent=Settings&module=Picklist&source_module=' . $this->getName(),

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

                    'linkicon' => 'fas fa-exchange-alt',

    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 \App\Db\Query())

    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

        }

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

                ['not in', 'vtiger_notes.notesid', (new App\Db\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $record])],

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

            ]);

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

                        $queryGenerator->setField($fieldName);

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

            return 'notes_title';

    Line exceeds 120 characters; contains 124 characters
    Open

            if (\App\Security\AdminAccess::isPermitted('Workflows') && VTWorkflowUtils::checkModuleWorkflow($this->getName())) {

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

                    'linklabel' => 'LBL_EDIT_WORKFLOWS',

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

                    'linkurl' => 'index.php?parent=Settings&module=LayoutEditor&sourceModule=' . $this->getName(),

    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 (\App\Security\AdminAccess::isPermitted('RecordNumbering') && $this->hasSequenceNumberField()) {

    Line exceeds 120 characters; contains 140 characters
    Open

                    'linkurl' => 'index.php?parent=Settings&module=RecordNumbering&view=CustomRecordNumbering&sourceModule=' . $this->getName(),

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

            if ('I' === $recordModel->get('filelocationtype') && ($href = $recordModel->getDownloadFileURL())) {

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

                $title = App\Language::translate('LBL_DOWNLOAD_FILE', 'Documents');

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

        public function isWorkflowSupported()

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

         * Function to get Alphabet Search Field.

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

                    'linkicon' => 'adminIcon-modules-fields',

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

        public function getAllFolders()

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

                ->scalar();

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

                ['vtiger_notes.filestatus' => 1],

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

        public function getAlphabetSearchField()

    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 array

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

                ->createCommand()->queryAllByGroup();

    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

            Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTWorkflowUtils.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

                $link = "<a href=\"{$href}\" title=\"{$title}\"><span class=\"fas fa-download ml-1\"></span></a>";

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

         * Function to check whether the module is summary view supported.

    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 getModalRecordsListFields(App\QueryGenerator $queryGenerator, $sourceModule = false)

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

            $headerFields = $queryGenerator->getListViewFields();

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

                    $fieldModel = $this->getFieldByName($fieldName);

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

                    if ($fieldModel->getPermissions()) {

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

        {

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

                $settingsLinks[] = [

    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

                ->from('vtiger_trees_templates_data')

    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

            $queryGenerator->addNativeCondition(['and',

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

            $popupFields = parent::getModalRecordsListFields($queryGenerator, $sourceModule);

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

                    'linklabel' => 'LBL_EDIT_PICKLIST_VALUES',

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

                    'linklabel' => 'LBL_MODULE_SEQUENCE_NUMBERING',

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

            $templateId = (new \App\Db\Query())->select(['vtiger_field.fieldparams'])

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

    class Documents_Module_Model extends Vtiger_Module_Model

    There are no issues that match your filters.

    Category
    Status