Showing 4,652 of 306,333 total issues
Method getParent
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0)
{
\App\Log::trace('Entering getParent(' . $id . ') method ...');
if ($depthBase == App\Config::module('Contacts', 'MAX_HIERARCHY_DEPTH')) {
\App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Function getData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getData: function (data) {
var mappingData = [];
var mappingConditions = [];
for (var i in data) {
var name = i.split('][');
- 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
Function loadMenuTree
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
loadMenuTree: function () {
var thisInstance = this;
if (thisInstance.treeInstance == false) {
var data = JSON.parse($('#treeValues').val());
if (data.length == 0) {
- 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
Function getDefaultParams
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
getDefaultParams: function () {
let container = this.getRelatedContainer();
let params = Object.assign({}, this.defaultParams);
params['page'] = this.getCurrentPageNum();
params['orderby'] = this.getOrderBy();
- 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
Function registerCalendar
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
registerCalendar: function () {
const self = this,
container = this.getContainer();
//Default time format
let userTimeFormat = CONFIG.hourFormat;
- 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
Function fillNewRecordData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
fillNewRecordData(moduleName) {
const data = {
email: this.mailItem.from.emailAddress,
email1: this.mailItem.from.emailAddress,
relationOperation: true,
- 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
Function validate
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
validate: function (dependentFieldList) {
let field = this.getElement();
let fieldInfo = field.data('fieldinfo');
let fieldLabel = fieldInfo.label;
let contextFormElem = field.closest('form');
- 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
Function getPermittedModuleIdList
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getPermittedModuleIdList()
{
$permittedModules = [];
require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
include 'user_privileges/tabdata.php';
- 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
Function updateCronTasks
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function updateCronTasks($modulenode)
{
if (empty($modulenode->crons) || empty($modulenode->crons->cron)) {
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
Function getByRecordModel
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function getByRecordModel(string $view, \Vtiger_Record_Model $recordModel, bool $cache = true): array
{
$cacheKey = $view . $recordModel->getId();
if ($cache && isset(self::$recordModelCache[$cacheKey])) {
return self::$recordModelCache[$cacheKey];
- 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
Function currencyDecimalFormat
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function currencyDecimalFormat($value, $user = null)
{
if (!$user) {
$user = \App\User::getCurrentUserModel();
}
- 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
Function resetPassword
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function resetPassword(): void
{
$this->climate->arguments->add([
'login' => [
'prefix' => 'l',
- 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
Function loadAdvancedConditions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function loadAdvancedConditions(): void
{
if (!empty($this->advancedConditions['relationId']) && ($relationModel = \Vtiger_Relation_Model::getInstanceById($this->advancedConditions['relationId']))) {
$typeRelationModel = $relationModel->getTypeRelationModel();
if (!method_exists($typeRelationModel, 'loadAdvancedConditionsByRelationId')) {
- 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
Function updateBySelect
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function updateBySelect(): void
{
$options = [];
$toInstall = \App\YetiForce\Updater::getToInstall();
foreach ($toInstall as $package) {
- 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
Function organization
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function organization(string $params): string
{
if (!$params) {
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
Function relatedRecordLevel
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function relatedRecordLevel($params)
{
[$fieldName, $relatedModule, $relatedRecord] = array_pad(explode('|', $params, 3), 3, '');
if (
!isset($this->recordModel)
- 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
Function addAdvConditions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function addAdvConditions(\App\QueryGenerator $queryGenerator, int $relationId, string $operator, ?array $condition, ?int $userId)
{
$relationModel = \Vtiger_Relation_Model::getInstanceById($relationId);
if (\Vtiger_Relation_Model::RELATION_M2M !== $relationModel->getRelationType()) {
$parentModuleName = $relationModel->getParentModuleModel()->getName();
- 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
Function process
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
if (!$this->textParser->recordModel || !$this->textParser->recordModel->getModule()->isInventory()) {
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
Function verifySender
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function verifySender(): array
{
$from = $this->getHeaderEmail('from');
if (!$from) {
return ['status' => true, 'info' => ''];
- 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
Function verifySpf
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function verifySpf(): array
{
if (isset($this->spfCache)) {
return $this->spfCache;
}
- 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"