YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/LayoutEditor/views/Index.php

Summary

Maintainability
B
4 hrs
Test Coverage
F
0%

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')) {
Severity: Major
Found in modules/Settings/LayoutEditor/views/Index.php - About 2 hrs to fix

    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')) {
    Severity: Minor
    Found in modules/Settings/LayoutEditor/views/Index.php - About 1 hr 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

    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()) {
    Severity: Major
    Found in modules/Settings/LayoutEditor/views/Index.php - About 40 mins to fix

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

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

      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)

      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([

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

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

      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);
              }

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

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

      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);
                      }

      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);
              }

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

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

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

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

      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'),

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

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

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

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

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

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('ACTIVE_TAB', $activeTab);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('INVENTORY_MODEL', Vtiger_Inventory_Model::getInstance($sourceModule));

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SELECTED_MODULE_NAME', $sourceModule);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SUPPORTED_MODULES', $supportedModulesList);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SUPPORTED_MODULES', $supportedModulesList);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('ADD_SUPPORTED_FIELD_TYPES', $moduleModel->getAddSupportedFieldTypes());

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

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SELECTED_MODULE_NAME', $sourceModule);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('IS_INVENTORY', $isInvenotry);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('RELATED_MODULES', $moduleModel->getRelations());

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('DISPLAY_TYPE_LIST', Vtiger_Field_Model::showDisplayTypeList());

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('QUALIFIED_MODULE', $qualifiedModule);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('MODULE', $qualifiedModule);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('MODULE_MULTI_REFERENCE_FIELDS', Settings_LayoutEditor_Module_Model::getMultiReferenceFieldsRelatedWithModule($sourceModule));

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SELECTED_MODULE_MODEL', $moduleModel);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('MODULE', $qualifiedModule);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('IN_ACTIVE_FIELDS', $inactiveFields);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('BASE_CUSTOM_VIEW', [

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('BLOCKS', $blockModels);

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('CHANGE_MODULE_TYPE_DISABLED', $batchMethod->isExists());

      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

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

      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

          public function process(App\Request $request)

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

          {

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

              $this->exposeMethod('showFieldLayout');

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

                  $this->invokeExposedMethod($mode, $request);

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

              $this->exposeMethod('showRelatedListLayout');

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

              }

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

              $qualifiedModule = $request->getModule(false);

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

                      if (!$fieldModel->isActiveField()) {

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

                      $fieldModelList = $blockIdFieldMap[$blockModel->get('id')];

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

              $viewer->assign('BLOCKS', $blockModels);

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

                  $sourceModule = $request->getByType('sourceModule', \App\Purifier::ALNUM);

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

              $viewer = $this->getViewer($request);

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

                  'relation' => \App\Language::translate('LBL_RECORDS_FROM_RELATION'),

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

          public function __construct()

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

          }

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

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

                  'method' => '\App\Module::changeType',

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

              $viewer->assign('QUALIFIED_MODULE', $qualifiedModule);

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

              $qualifiedModule = $request->getModule(false);

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

              $supportedModulesList = Settings_LayoutEditor_Module_Model::getSupportedModules();

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

                  //To get the first element

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

              }

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

                  'private' => \App\Language::translate('LBL_RCV_PRIVATE', $qualifiedModule),

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

          use \App\Controller\ExposeMethod;

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

              if ($this->isMethodExposed($mode)) {

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

              } else {

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

                  $activeTab = $request->getByType('tab', \App\Purifier::ALNUM);

      Line exceeds 120 characters; contains 121 characters
      Open

              $moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);

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

              $viewer->assign('IN_ACTIVE_FIELDS', $inactiveFields);

      Line exceeds 120 characters; contains 121 characters
      Open

              $moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);

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

          }

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

              $mode = $request->getMode();

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

              $supportedModulesList = Settings_LayoutEditor_Module_Model::getSupportedModules();

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

                  //To get the first element

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

              foreach ($blockModels as $blockModel) {

      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 (isset($blockIdFieldMap[$blockModel->get('id')])) {

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

              foreach ($fieldModels as $fieldModel) {

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

                  $fieldName = $fieldModel->getName();

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

              $viewer->assign('ACTIVE_TAB', $activeTab);

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

              $isInvenotry = $moduleModel->getSourceModule()->isInventory();

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

              ]));

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

              $viewer->assign('DISPLAY_TYPE_LIST', Vtiger_Field_Model::showDisplayTypeList());

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

              $viewer = $this->getViewer($request);

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

              $viewer->view('Index.tpl', $qualifiedModule);

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

              $viewer->assign('SELECTED_MODULE_NAME', $sourceModule);

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

              $viewer->assign('MODULE_MULTI_REFERENCE_FIELDS', Settings_LayoutEditor_Module_Model::getMultiReferenceFieldsRelatedWithModule($sourceModule));

      Line exceeds 120 characters; contains 150 characters
      Open

              $viewer->assign('MODULE_MULTI_REFERENCE_FIELDS', Settings_LayoutEditor_Module_Model::getMultiReferenceFieldsRelatedWithModule($sourceModule));

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

              $viewer->assign('RELATED_MODULES', $moduleModel->getRelations());

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

                  'all' => \App\Language::translate('LBL_RCV_ALL', $qualifiedModule),

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

              $viewer->view('RelatedList.tpl', $qualifiedModule);

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

          }

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

                  $this->showFieldLayout($request);

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

              if (empty($sourceModule)) {

      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 showFieldLayout(App\Request $request)

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

              $viewer->assign('SELECTED_MODULE_NAME', $sourceModule);

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

                  $sourceModule = reset($supportedModulesList);

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

              $viewer->assign('IS_INVENTORY', $isInvenotry);

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

              $blockIdFieldMap = [];

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

              }

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

              $moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);

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

              parent::__construct();

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

              if ($request->has('tab')) {

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

              }

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

                          $inactiveFields[$fieldModel->getBlockId()][$fieldModel->getId()] = \App\Language::translate($fieldModel->getLabel(), $sourceModule);

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

              $type = $isInvenotry ? Vtiger_Module_Model::STANDARD_TYPE : Vtiger_Module_Model::ADVANCED_TYPE;

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

                  'params' => [$sourceModule, $type],

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

              $viewer->assign('MODULE', $qualifiedModule);

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

          public function showRelatedListLayout(App\Request $request)

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

                  $sourceModule = Vtiger_Module_Model::getInstance($moduleName)->getName();

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

              ]);

      Line exceeds 120 characters; contains 136 characters
      Open

              return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['libraries.clipboard.dist.clipboard']));

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

              $sourceModule = $request->getByType('sourceModule', \App\Purifier::ALNUM);

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

              $blockModels = $moduleModel->getBlocks();

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

                      $firstItem = str_replace($lastItem, '', $fieldName);

      Line exceeds 120 characters; contains 152 characters
      Open

                          $inactiveFields[$fieldModel->getBlockId()][$fieldModel->getId()] = \App\Language::translate($fieldModel->getLabel(), $sourceModule);

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

              $viewer->assign('SELECTED_MODULE_MODEL', $moduleModel);

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

          {

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

              $viewer->assign('MODULE', $qualifiedModule);

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

                  //by default show field layout

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

              $activeTab = 'detailViewLayout';

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

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

              $batchMethod = (new \App\BatchMethod([

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

              $viewer->assign('CHANGE_MODULE_TYPE_DISABLED', $batchMethod->isExists());

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

              $viewer->assign('INVENTORY_MODEL', Vtiger_Inventory_Model::getInstance($sourceModule));

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

              if ($request->isEmpty('sourceModule', true)) {

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

                  } else {

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

                      $blockIdFieldMap[$fieldModel->getBlockId()][$fieldName] = $fieldModel;

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

              $viewer->assign('ADD_SUPPORTED_FIELD_TYPES', $moduleModel->getAddSupportedFieldTypes());

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

              $viewer->assign('SUPPORTED_MODULES', $supportedModulesList);

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

              $fieldModels = $moduleModel->getFields();

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

                  $firstItem = '';

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

                  if ('_extra' === $lastItem) {

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

                  }

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

                      $blockModel->setFields($fieldModelList);

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

              } else {

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

          {

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

                      unset($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

              $viewer->assign('SUPPORTED_MODULES', $supportedModulesList);

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

              $viewer->assign('BASE_CUSTOM_VIEW', [

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

              $viewer->assign('QUALIFIED_MODULE', $qualifiedModule);

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

          public function getFooterScripts(App\Request $request)

      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_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['libraries.clipboard.dist.clipboard']));

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

              $moduleModel = Settings_LayoutEditor_Module_Model::getInstance($qualifiedModule)->setSourceModule($sourceModule);

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

              $inactiveFields = [];

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

                  $lastItem = strrchr($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

              }

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

                  $moduleName = reset($supportedModulesList);

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

      class Settings_LayoutEditor_Index_View extends Settings_Vtiger_Index_View

      There are no issues that match your filters.

      Category
      Status