Method showFieldLayout
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showFieldLayout(App\Request $request)
{
$qualifiedModule = $request->getModule(false);
$activeTab = 'detailViewLayout';
if ($request->has('tab')) {
Function showFieldLayout
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function showFieldLayout(App\Request $request)
{
$qualifiedModule = $request->getModule(false);
$activeTab = 'detailViewLayout';
if ($request->has('tab')) {
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if ((!empty($firstItem) && !empty($firstItemModuleModal = \Vtiger_Field_Model::getInstance($firstItem, \Vtiger_Module_Model::getInstance($sourceModule))) && $firstItemModuleModal->isActiveField() && $fieldModel->isActiveField()) && (11 == $firstItemModuleModal->getUIType()) && (1 == $fieldModel->getUIType())) {
unset($fieldName);
} else {
$blockIdFieldMap[$fieldModel->getBlockId()][$fieldName] = $fieldModel;
if (!$fieldModel->isActiveField()) {
The method showFieldLayout() has an NPath complexity of 408. The configured NPath complexity threshold is 200. Open
public function showFieldLayout(App\Request $request)
{
$qualifiedModule = $request->getModule(false);
$activeTab = 'detailViewLayout';
if ($request->has('tab')) {
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method showFieldLayout() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10. Open
public function showFieldLayout(App\Request $request)
{
$qualifiedModule = $request->getModule(false);
$activeTab = 'detailViewLayout';
if ($request->has('tab')) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. Open
public function showFieldLayout(App\Request $request)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Missing class import via use statement (line '78', column '23'). Open
$batchMethod = (new \App\BatchMethod([
- Read upRead up
- Exclude checks
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 'Vtiger_Field_Model' in method 'showFieldLayout'. Open
$viewer->assign('DISPLAY_TYPE_LIST', Vtiger_Field_Model::showDisplayTypeList());
- Read upRead up
- Exclude checks
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 'Settings_LayoutEditor_Module_Model' in method 'showRelatedListLayout'. Open
$supportedModulesList = Settings_LayoutEditor_Module_Model::getSupportedModules();
- Read upRead up
- Exclude checks
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
The method showRelatedListLayout uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$sourceModule = $request->getByType('sourceModule', \App\Purifier::ALNUM);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Language' in method 'showFieldLayout'. Open
$inactiveFields[$fieldModel->getBlockId()][$fieldModel->getId()] = \App\Language::translate($fieldModel->getLabel(), $sourceModule);
- Read upRead up
- Exclude checks
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_Module_Model' in method 'showFieldLayout'. Open
if ((!empty($firstItem) && !empty($firstItemModuleModal = \Vtiger_Field_Model::getInstance($firstItem, \Vtiger_Module_Model::getInstance($sourceModule))) && $firstItemModuleModal->isActiveField() && $fieldModel->isActiveField()) && (11 == $firstItemModuleModal->getUIType()) && (1 == $fieldModel->getUIType())) {
- Read upRead up
- Exclude checks
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
The method showFieldLayout uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$blockIdFieldMap[$fieldModel->getBlockId()][$fieldName] = $fieldModel;
if (!$fieldModel->isActiveField()) {
$inactiveFields[$fieldModel->getBlockId()][$fieldModel->getId()] = \App\Language::translate($fieldModel->getLabel(), $sourceModule);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
//by default show field layout
$this->showFieldLayout($request);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Vtiger_Field_Model' in method 'showFieldLayout'. Open
if ((!empty($firstItem) && !empty($firstItemModuleModal = \Vtiger_Field_Model::getInstance($firstItem, \Vtiger_Module_Model::getInstance($sourceModule))) && $firstItemModuleModal->isActiveField() && $fieldModel->isActiveField()) && (11 == $firstItemModuleModal->getUIType()) && (1 == $fieldModel->getUIType())) {
- Read upRead up
- Exclude checks
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 'Settings_LayoutEditor_Module_Model' in method 'showRelatedListLayout'. Open
$viewer->assign('MODULE_MULTI_REFERENCE_FIELDS', Settings_LayoutEditor_Module_Model::getMultiReferenceFieldsRelatedWithModule($sourceModule));
- Read upRead up
- Exclude checks
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 '60', column '38'). Open
public function showFieldLayout(App\Request $request)
{
$qualifiedModule = $request->getModule(false);
$activeTab = 'detailViewLayout';
if ($request->has('tab')) {
- Read upRead up
- Exclude checks
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 'Settings_LayoutEditor_Module_Model' in method 'showFieldLayout'. Open
$supportedModulesList = Settings_LayoutEditor_Module_Model::getSupportedModules();
- Read upRead up
- Exclude checks
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 'showRelatedListLayout'. Open
'relation' => \App\Language::translate('LBL_RECORDS_FROM_RELATION'),
- Read upRead up
- Exclude checks
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 'showRelatedListLayout'. Open
'all' => \App\Language::translate('LBL_RCV_ALL', $qualifiedModule),
- Read upRead up
- Exclude checks
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_Inventory_Model' in method 'showFieldLayout'. Open
$viewer->assign('INVENTORY_MODEL', Vtiger_Inventory_Model::getInstance($sourceModule));
- Read upRead up
- Exclude checks
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 'showRelatedListLayout'. Open
'private' => \App\Language::translate('LBL_RCV_PRIVATE', $qualifiedModule),
- Read upRead up
- Exclude checks
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 "sourceModule" 3 times. Open
$sourceModule = $request->getByType('sourceModule', \App\Purifier::ALNUM);
- Read upRead up
- Exclude checks
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 \Vtiger_Viewer::assign
Open
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('ACTIVE_TAB', $activeTab);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('INVENTORY_MODEL', Vtiger_Inventory_Model::getInstance($sourceModule));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SUPPORTED_MODULES', $supportedModulesList);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SUPPORTED_MODULES', $supportedModulesList);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('ADD_SUPPORTED_FIELD_TYPES', $moduleModel->getAddSupportedFieldTypes());
- Exclude checks
Variable $firstItemModuleModal
is undeclared Open
if ((!empty($firstItem) && !empty($firstItemModuleModal = \Vtiger_Field_Model::getInstance($firstItem, \Vtiger_Module_Model::getInstance($sourceModule))) && $firstItemModuleModal->isActiveField() && $fieldModel->isActiveField()) && (11 == $firstItemModuleModal->getUIType()) && (1 == $fieldModel->getUIType())) {
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('IS_INVENTORY', $isInvenotry);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('RELATED_MODULES', $moduleModel->getRelations());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('DISPLAY_TYPE_LIST', Vtiger_Field_Model::showDisplayTypeList());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE', $qualifiedModule);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE_MULTI_REFERENCE_FIELDS', Settings_LayoutEditor_Module_Model::getMultiReferenceFieldsRelatedWithModule($sourceModule));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SELECTED_MODULE_MODEL', $moduleModel);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE', $qualifiedModule);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('IN_ACTIVE_FIELDS', $inactiveFields);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('BASE_CUSTOM_VIEW', [
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('BLOCKS', $blockModels);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('CHANGE_MODULE_TYPE_DISABLED', $batchMethod->isExists());
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_LayoutEditor_Index_View extends Settings_Vtiger_Index_View
- Exclude checks
The class Settings_LayoutEditor_Index_View is not named in CamelCase. Open
class Settings_LayoutEditor_Index_View extends Settings_Vtiger_Index_View
{
use \App\Controller\ExposeMethod;
public function __construct()
- Read upRead up
- Exclude checks
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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exposeMethod('showFieldLayout');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->invokeExposedMethod($mode, $request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exposeMethod('showRelatedListLayout');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedModule = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$fieldModel->isActiveField()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModelList = $blockIdFieldMap[$blockModel->get('id')];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('BLOCKS', $blockModels);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = $request->getByType('sourceModule', \App\Purifier::ALNUM);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relation' => \App\Language::translate('LBL_RECORDS_FROM_RELATION'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __construct()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 324 characters Open
if ((!empty($firstItem) && !empty($firstItemModuleModal = \Vtiger_Field_Model::getInstance($firstItem, \Vtiger_Module_Model::getInstance($sourceModule))) && $firstItemModuleModal->isActiveField() && $fieldModel->isActiveField()) && (11 == $firstItemModuleModal->getUIType()) && (1 == $fieldModel->getUIType())) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'method' => '\App\Module::changeType',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedModule = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$supportedModulesList = Settings_LayoutEditor_Module_Model::getSupportedModules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//To get the first element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'private' => \App\Language::translate('LBL_RCV_PRIVATE', $qualifiedModule),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
use \App\Controller\ExposeMethod;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->isMethodExposed($mode)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$activeTab = $request->getByType('tab', \App\Purifier::ALNUM);
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
$moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('IN_ACTIVE_FIELDS', $inactiveFields);
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
$moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$mode = $request->getMode();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$supportedModulesList = Settings_LayoutEditor_Module_Model::getSupportedModules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//To get the first element
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($blockModels as $blockModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($blockIdFieldMap[$blockModel->get('id')])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fieldModels as $fieldModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldName = $fieldModel->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('ACTIVE_TAB', $activeTab);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isInvenotry = $moduleModel->getSourceModule()->isInventory();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('DISPLAY_TYPE_LIST', Vtiger_Field_Model::showDisplayTypeList());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('Index.tpl', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MODULE_MULTI_REFERENCE_FIELDS', Settings_LayoutEditor_Module_Model::getMultiReferenceFieldsRelatedWithModule($sourceModule));
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
$viewer->assign('MODULE_MULTI_REFERENCE_FIELDS', Settings_LayoutEditor_Module_Model::getMultiReferenceFieldsRelatedWithModule($sourceModule));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RELATED_MODULES', $moduleModel->getRelations());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'all' => \App\Language::translate('LBL_RCV_ALL', $qualifiedModule),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('RelatedList.tpl', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->showFieldLayout($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($sourceModule)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function showFieldLayout(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SELECTED_MODULE_NAME', $sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = reset($supportedModulesList);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('IS_INVENTORY', $isInvenotry);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockIdFieldMap = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::__construct();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($request->has('tab')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inactiveFields[$fieldModel->getBlockId()][$fieldModel->getId()] = \App\Language::translate($fieldModel->getLabel(), $sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $isInvenotry ? Vtiger_Module_Model::STANDARD_TYPE : Vtiger_Module_Model::ADVANCED_TYPE;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'params' => [$sourceModule, $type],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MODULE', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function showRelatedListLayout(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = Vtiger_Module_Model::getInstance($moduleName)->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['libraries.clipboard.dist.clipboard']));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = $request->getByType('sourceModule', \App\Purifier::ALNUM);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockModels = $moduleModel->getBlocks();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$firstItem = str_replace($lastItem, '', $fieldName);
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
$inactiveFields[$fieldModel->getBlockId()][$fieldModel->getId()] = \App\Language::translate($fieldModel->getLabel(), $sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SELECTED_MODULE_MODEL', $moduleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MODULE', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//by default show field layout
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$activeTab = 'detailViewLayout';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ((!empty($firstItem) && !empty($firstItemModuleModal = \Vtiger_Field_Model::getInstance($firstItem, \Vtiger_Module_Model::getInstance($sourceModule))) && $firstItemModuleModal->isActiveField() && $fieldModel->isActiveField()) && (11 == $firstItemModuleModal->getUIType()) && (1 == $fieldModel->getUIType())) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$batchMethod = (new \App\BatchMethod([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('CHANGE_MODULE_TYPE_DISABLED', $batchMethod->isExists());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('INVENTORY_MODEL', Vtiger_Inventory_Model::getInstance($sourceModule));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($request->isEmpty('sourceModule', true)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockIdFieldMap[$fieldModel->getBlockId()][$fieldName] = $fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('ADD_SUPPORTED_FIELD_TYPES', $moduleModel->getAddSupportedFieldTypes());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SUPPORTED_MODULES', $supportedModulesList);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModels = $moduleModel->getFields();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$firstItem = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('_extra' === $lastItem) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockModel->setFields($fieldModelList);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($fieldName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SUPPORTED_MODULES', $supportedModulesList);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('BASE_CUSTOM_VIEW', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFooterScripts(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['libraries.clipboard.dist.clipboard']));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inactiveFields = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastItem = strrchr($fieldName, '_');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = reset($supportedModulesList);
- Exclude checks
Class name "Settings_LayoutEditor_Index_View" is not in camel caps format Open
class Settings_LayoutEditor_Index_View extends Settings_Vtiger_Index_View
- Exclude checks