Function transferListSearchParamsToFilterCondition
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function transferListSearchParamsToFilterCondition($searchParams, Settings_Vtiger_Module_Model $moduleModel)
{
if (empty($searchParams)) {
return [];
}
- 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
Method getPagination
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPagination(App\Request $request)
{
$viewer = $this->getViewer($request);
$pageNumber = $request->getInteger('page');
$searchResult = $request->get('searchResult');
Method transferListSearchParamsToFilterCondition
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function transferListSearchParamsToFilterCondition($searchParams, Settings_Vtiger_Module_Model $moduleModel)
{
if (empty($searchParams)) {
return [];
}
Function getPagination
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getPagination(App\Request $request)
{
$viewer = $this->getViewer($request);
$pageNumber = $request->getInteger('page');
$searchResult = $request->get('searchResult');
- 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
The method getPagination() has an NPath complexity of 1944. The configured NPath complexity threshold is 200. Open
public function getPagination(App\Request $request)
{
$viewer = $this->getViewer($request);
$pageNumber = $request->getInteger('page');
$searchResult = $request->get('searchResult');
- 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 getPagination() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
public function getPagination(App\Request $request)
{
$viewer = $this->getViewer($request);
$pageNumber = $request->getInteger('page');
$searchResult = $request->get('searchResult');
- 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
The method transferListSearchParamsToFilterCondition() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
public function transferListSearchParamsToFilterCondition($searchParams, Settings_Vtiger_Module_Model $moduleModel)
{
if (empty($searchParams)) {
return [];
}
- 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 33 to the 15 allowed. Open
public function transferListSearchParamsToFilterCondition($searchParams, Settings_Vtiger_Module_Model $moduleModel)
- 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 '37', column '22'). Open
$pagingModel = new Vtiger_Paging_Model();
- 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 'Settings_Vtiger_ListView_Model' in method 'getPagination'. Open
$listViewModel = Settings_Vtiger_ListView_Model::getInstance($qualifiedModuleName);
- 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_TreesManager_Record_Model' in method 'transferListSearchParamsToFilterCondition'. Open
$fieldValue = Settings_TreesManager_Record_Model::getChildren($fieldValue, $fieldName, $moduleModel);
- 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\Fields\Time' in method 'transferListSearchParamsToFilterCondition'. Open
$fieldValue = \App\Fields\Time::sanitizeDbFormat($fieldValue);
- 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 transferListSearchParamsToFilterCondition uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$dateTimeCompoenents[1] = '23:59:59';
}
- 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
Define a constant instead of duplicating this literal "sourceModule" 3 times. Open
if (!$request->isEmpty('sourceModule')) {
- 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.
Reference to undeclared property \Settings_Vtiger_Pagination_View->listViewEntries
Open
if (!property_exists($this, 'listViewEntries') || empty($this->listViewEntries)) {
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
- Exclude checks
Reference to undeclared property \Settings_Vtiger_Pagination_View->listViewEntries
Open
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('ALPHABET_VALUE', $searchValue);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('PAGE_NUMBER', $pageNumber);
- Exclude checks
Reference to undeclared property \Settings_Vtiger_Pagination_View->listViewCount
Open
$this->listViewCount = $listViewModel->getListViewCount();
- Exclude checks
Argument 3 (moduleModel)
is \App\Base|\Settings_Vtiger_Module_Model
but \Settings_TreesManager_Record_Model::getChildren()
takes \Vtiger_Module_Model
defined at /code/modules/Settings/TreesManager/models/Record.php:355
Open
$fieldValue = Settings_TreesManager_Record_Model::getChildren($fieldValue, $fieldName, $moduleModel);
- Exclude checks
Reference to undeclared property \Settings_Vtiger_Pagination_View->listViewCount
Open
if (!property_exists($this, 'listViewCount') || empty($this->listViewCount)) {
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('PAGE_COUNT', $pageCount);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('START_PAGIN_FROM', $startPaginFrom);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('PAGING_MODEL', $pagingModel);
- Exclude checks
Reference to undeclared property \Settings_Vtiger_Pagination_View->listViewEntries
Open
$noOfEntries = \count($this->listViewEntries);
- Exclude checks
Call to undeclared method \Settings_Vtiger_Module_Model::getFieldByName
Open
$field = $moduleModel->getFieldByName($fieldName);
- Exclude checks
Reference to undeclared property \Settings_Vtiger_Pagination_View->listViewCount
Open
$totalCount = $this->listViewCount;
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('OPERATOR', $operator);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('LISTVIEW_COUNT', $totalCount);
- Exclude checks
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ('date_start' === $fieldName || 'due_date' === $fieldName || 'datetime' === $field->getFieldDataType()) {
$dateValues = explode(',', $fieldValue);
//Indicate whether it is fist date in the between condition
$isFirstDate = true;
foreach ($dateValues as $key => $dateValue) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 149.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long variable names like $transformedSearchParams. Keep variable name length under 20. Open
$transformedSearchParams = $this->transferListSearchParamsToFilterCondition($searchParams, $listViewModel->getModule());
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $advFilterConditionFormat. Keep variable name length under 20. Open
$advFilterConditionFormat = [];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Vtiger_Pagination_View extends Settings_Vtiger_IndexAjax_View
- Exclude checks
The class Settings_Vtiger_Pagination_View is not named in CamelCase. Open
class Settings_Vtiger_Pagination_View extends Settings_Vtiger_IndexAjax_View
{
public function __construct()
{
parent::__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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to transfer a list of searched parameters to the filter.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('time' === $field->getFieldDataType()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Indicate whether it is fist date in the between condition
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedModuleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pagingModel->set('viewid', $request->getByType('viewname', 2));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$listViewModel->get('query_generator')->addNativeCondition(['vtiger_crmentity.crmid' => $searchResult]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pageCount = $pagingModel->getPageCount();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('PAGE_COUNT', $pageCount);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Settings_Vtiger_Module_Model $moduleModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$groupColumnsInfo = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$field = $moduleModel->getFieldByName($fieldName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Request will be having in terms of AM and PM but the database will be having in 24 hr format so converting
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
if ('date_start' === $fieldName || 'due_date' === $fieldName || 'datetime' === $field->getFieldDataType()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$searchKey = $request->getByType('search_key', 'Alnum');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($searchParams) || !\is_array($searchParams)) {
- 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
return [];
- 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
$isFirstDate = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($isFirstDate) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exposeMethod('getPagination');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pageNumber = $request->getInteger('page');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$listViewModel->set('sourceModule', $sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pagingModel = new Vtiger_Paging_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$operator = $request->getByType('operator', 1);
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$transformedSearchParams = $this->transferListSearchParamsToFilterCondition($searchParams, $listViewModel->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$listViewModel->set('search_params', $transformedSearchParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dateValue = implode(' ', $dateTimeCompoenents);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isFirstDate = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('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
$listViewModel->set('search_value', $searchValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($groupInfo)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('date_start' === $fieldName || 'due_date' === $fieldName || 'datetime' === $field->getFieldDataType()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($dateValues as $key => $dateValue) {
- 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
$searchValue = $request->getByType('search_value', 'Text');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($searchKey) && !empty($searchValue)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$searchParams = $request->getArray('search_params');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pagingModel->set('totalCount', (int) $totalCount);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('PAGE_NUMBER', $pageNumber);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo $viewer->view('Pagination.tpl', $qualifiedModuleName, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $searchParams
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$glueOrder = ['and', 'or'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('tree' === $field->getFieldDataType() && $specialOption) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldValue = \App\Fields\Time::sanitizeDbFormat($fieldValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($dateTimeCompoenents[1])) {
- 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
$pagingModel->set('page', $pageNumber);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('OPERATOR', $operator);
- 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->listViewCount = $listViewModel->getListViewCount();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$noOfEntries = \count($this->listViewEntries);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$advFilterConditionFormat = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldValue = Settings_TreesManager_Record_Model::getChildren($fieldValue, $fieldName, $moduleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dateTimeCompoenents[1] = '00:00:00';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$groupColumnsInfo[] = ['columnname' => $field->getCustomViewColumnName(), 'comparator' => $operator, 'value' => $fieldValue];
- 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
$listViewModel = Settings_Vtiger_ListView_Model::getInstance($qualifiedModuleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pageNumber = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$totalCount = $this->listViewCount;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$startPaginFrom = $pagingModel->getStartPagingFrom();
- 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
foreach ($groupInfo as &$fieldSearchInfo) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dateTimeCompoenents[1] = '23:59:59';
- 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 (!property_exists($this, 'listViewEntries') || empty($this->listViewEntries)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($searchParams as &$groupInfo) {
- 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 = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('ALPHABET_VALUE', $searchValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$listViewModel->set('search_key', $searchKey);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dateTimeCompoenents = explode(' ', $dateValue);
- 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
$advFilterConditionFormat[$glueOrder[$groupIterator]] = $groupColumnsInfo;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dateValues[$key] = $dateValue;
- 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
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
++$groupIterator;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$searchResult = $request->get('searchResult');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = $request->getByType('sourceModule', 2);
- 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 (!empty($searchResult) && \is_array($searchResult)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('LISTVIEW_COUNT', $totalCount);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('START_PAGIN_FROM', $startPaginFrom);
- 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 transferListSearchParamsToFilterCondition($searchParams, Settings_Vtiger_Module_Model $moduleModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$groupIterator = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[$fieldName, $operator, $fieldValue, $specialOption] = $fieldSearchInfo;
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
$fieldValue = Settings_TreesManager_Record_Model::getChildren($fieldValue, $fieldName, $moduleModel);
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
//Request will be having in terms of AM and PM but the database will be having in 24 hr format so converting
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
$groupColumnsInfo[] = ['columnname' => $field->getCustomViewColumnName(), 'comparator' => $operator, 'value' => $fieldValue];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $advFilterConditionFormat;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPagination(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('PAGING_MODEL', $pagingModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($searchParams)) {
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Pagination.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($operator)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$listViewModel->set('operator', $operator);
- 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 (!property_exists($this, 'listViewCount') || empty($this->listViewCount)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($pageNumber)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$searchParams = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$transformedSearchParams = $this->transferListSearchParamsToFilterCondition($searchParams, $listViewModel->getModule());
- 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
- 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
$dateValues = explode(',', $fieldValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldValue = implode(',', $dateValues);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Class name "Settings_Vtiger_Pagination_View" is not in camel caps format Open
class Settings_Vtiger_Pagination_View extends Settings_Vtiger_IndexAjax_View
- Exclude checks