Showing 4,652 of 306,333 total issues
Function getDisplayValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
{
$info = self::getRecurringInfo($value);
$text = '';
if ($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 getDBValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDBValue($value, $recordModel = false)
{
if ($value) {
$fieldsModel = $this->getFieldsModel();
foreach ($value as &$item) {
- 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 editViewChangeValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function editViewChangeValue(App\EventHandler $eventHandler): array
{
$return = [];
$recordModel = $eventHandler->getRecordModel();
foreach (\App\Fields\Picklist::getDependencyForModule($eventHandler->getModuleName())['conditions'] as $fieldName => $values) {
- 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 setWidgetModel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function setWidgetModel($widgetModel)
{
$this->widgetModel = $widgetModel;
$this->extraData = App\Json::decode($this->widgetModel->get('data'));
$this->getTargetModuleModel();
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = false)
{
if (empty($value) || isset($this->validate[$value])) {
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 getRelatedColumnName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedColumnName($relatedModule, $findModule)
{
$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);
$relatedModelFields = $relatedModuleModel->getFields();
foreach ($relatedModelFields as $fieldModel) {
- 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 getFieldsForView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldsForView(string $view): array
{
$fieldList = [];
switch ($view) {
case 'DetailPreview':
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = false)
{
if (empty($value) || isset($this->validate[$value])) {
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 getListViewDisplayValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getListViewDisplayValue($value, $record = false, $recordModel = false, $rawText = false)
{
if ($value && !$rawText) {
$moduleName = $this->getFieldModel()->get('block')->module->name;
$fieldName = $this->getFieldModel()->get('name');
- 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 getDisplayValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
{
if ($value && !$rawText) {
$moduleName = $this->getFieldModel()->get('block')->module->name;
$fieldName = $this->getFieldModel()->get('name');
- 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 getValueToExport
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getValueToExport($value, int $recordId)
{
$parts = explode(',', trim($value, ', '));
$values = \App\Fields\Tree::getValuesById((int) $this->getFieldModel()->getFieldParams());
foreach ($parts as &$part) {
- 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 loadCondition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function loadCondition()
{
$relatedModuleName = $this->getRelatedModuleModel()->getName();
$queryGenerator = $this->getRelationModel()->getQueryGenerator();
if ($entityState = $this->get('entityState')) {
- 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 setChartDatasetsColorsMulti
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function setChartDatasetsColorsMulti(&$chartData, $datasetIndex, $dataset, $groupValue, $group, $dividingValue, $dividing)
{
if ((!empty($group['color_id']) && !empty($this->colors[$group['color_id']])) || !isset($group['color_id'])) {
if (!isset($group['color_id'])) {
// we have all fields colors
- 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 createInventoryTables
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createInventoryTables()
{
$db = \App\Db::getInstance();
$importer = new \App\Db\Importers\Base();
$focus = CRMEntity::getInstance($this->getModuleName());
- 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 getTitle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getTitle($prefix = '')
{
$title = $this->widgetModel->get('title');
if (empty($title)) {
$suffix = '';
- 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 getSideBarLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getSideBarLinks($linkParams)
{
$linkTypes = ['SIDEBARLINK', 'SIDEBARWIDGET'];
$moduleLinks = $this->getModule()->getSideBarLinks($linkTypes);
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = false)
{
if (empty($value) || isset($this->validate[$value])) {
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 iterateAllRows
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function iterateAllRows($callback)
{
foreach ($this->rows as $dividingValue => $groupRows) {
foreach ($groupRows as $groupValue => $group) {
foreach ($group as $rowIndex => $row) {
- 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 getRecords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getRecords()
{
$selectedRecords = $this->getSelectedRecords();
$isDeletable = $this->isDeletable();
if (2 == $this->getRelationType()) {
- 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 getActiveTemplatesForRecord
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getActiveTemplatesForRecord($recordId, $view, $moduleName = false)
{
if (!\App\Record::isExists($recordId)) {
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"