YetiForceCompany/YetiForceCRM

View on GitHub
modules/KnowledgeBase/models/RecordPopover.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid unused local variables such as '$fieldLabel'.
Open

        foreach ($this->recordModel->getEntity()->list_fields_name as $fieldLabel => $fieldName) {

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Reference to undeclared property \CRMEntity->list_fields_name
Open

        foreach ($this->recordModel->getEntity()->list_fields_name as $fieldLabel => $fieldName) {

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

class KnowledgeBase_RecordPopover_Model extends Vtiger_RecordPopover_Model

The class KnowledgeBase_RecordPopover_Model is not named in CamelCase.
Open

class KnowledgeBase_RecordPopover_Model extends Vtiger_RecordPopover_Model
{
    /** {@inheritdoc} */
    public function getFields(): array
    {

CamelCaseClassName

Since: 0.2

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

Example

class class_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

        $summaryFields = [];

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

        foreach ($this->recordModel->getEntity()->list_fields_name as $fieldLabel => $fieldName) {

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

            if ($fieldModel && !$this->recordModel->isEmpty($fieldName) && $fieldModel->isViewableInDetailView()) {

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

        return $summaryFields;

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

    }

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

                $summaryFields[$fieldName] = $fieldModel;

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

    {

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

        $fields = $this->recordModel->getModule()->getFields();

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

    public function getFields(): array

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

        }

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

            $fieldModel = $fields[$fieldName] ?? '';

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

    /** {@inheritdoc} */

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

class KnowledgeBase_RecordPopover_Model extends Vtiger_RecordPopover_Model

There are no issues that match your filters.

Category
Status