Showing 4,652 of 306,333 total issues
Function getFieldsTypes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldsTypes(): array
{
$moduleName = $this->getModuleName();
if (\App\Cache::has(__METHOD__, $moduleName)) {
$inventoryTypes = \App\Cache::get(__METHOD__, $moduleName);
- 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 getWatchingUsers
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getWatchingUsers($restrictUsers = [])
{
if (!$this->watchingUsers) {
$users = $this->getModuleUsers();
if ($this->has('record')) {
- 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 getReference
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getReference(App\Request $request): void
{
if ($request->has('fieldName')) {
$fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$moduleName = $request->getModule();
$recordIds = self::getRecordsListFromRequest($request);
$skipped = [];
- 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 sendMails
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function sendMails(App\Request $request): void
{
$moduleName = $request->getModule();
$field = $request->getByType('field', 'Alnum');
$sourceModule = $request->getByType('sourceModule', 'Alnum');
- 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 getParent
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
{
\App\Log::trace('Entering getParent(' . $id . ') method ...');
if ($depthBase === \App\Config::module('HelpDesk', 'MAX_HIERARCHY_DEPTH')) {
\App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
- 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 read
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function read()
{
$defaultCharset = App\Config::main('default_charset');
$filePath = $this->getFilePath();
- 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 cleanup
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function cleanup($tasks)
{
$clean = [];
foreach ($tasks as $task) {
if (0 !== $task['id']) {
- 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 getRawDataFromRow
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function getRawDataFromRow(array $row): array
{
foreach ($this->fields as $fieldName => $fieldModel) {
if (\array_key_exists($fieldName, $row)) {
$row[$fieldName] = $fieldModel->getUITypeModel()->getRawValue($row[$fieldName]);
- 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 normalizeParents
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function normalizeParents()
{
// not set parents are children of root node
foreach ($this->tasks as &$task) {
if (!isset($task['parent']) && 0 !== $task['id']) {
- 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
File CalendarView.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
'use strict';
/**
* Class representing an extended calendar.
* @extends Calendar_Calendar_Js
File CalDAV.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Api CalDAV Model Class.
*
Function registerAddCustomFieldEvent
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerAddCustomFieldEvent() {
const thisInstance = this;
let contents = this.container.find('.contents');
contents.find('.addCustomField').on('click', (e) => {
let blockId = $(e.currentTarget).closest('.editFieldsTable').data('blockId'),
Function registerStep2
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerStep2: function (container, blockId) {
let thisInstance = this;
let containerInventory = thisInstance.getInventoryViewLayout();
let form = container.find('form');
let selectedModule = this.container.find('[name="layoutEditorModules"]').val();
Function showFormToEditKey
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
showFormToEditKey: function (id, type) {
var thisInstance = this;
var params = {
module: app.getModuleName(),
parent: app.getParentModuleName(),
Function getUi
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
getUi: function () {
let comparatorSelectedOptionVal = this.get('comparatorElementVal'),
dateSpecificConditions = this.get('dateSpecificConditions'),
html,
element;
Function registerEventForModal
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerEventForModal: function (container) {
const self = this;
let table = app.registerDataTables(container.find('.js-watching-data-table'));
app.showPopoverElementView(container.find('.infoPopover'));
container.on('switchChange.bootstrapSwitch', '.sendNotificationsSwitch', function (e, state) {
Function getUi
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
getUi: function () {
let comparatorSelectedOptionVal = this.get('comparatorElementVal'),
dateSpecificConditions = this.get('dateSpecificConditions'),
html,
element;
Function loadWidget
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadWidget: function (widgetContainer, params) {
const thisInstance = this,
contentContainer = $('.js-detail-widget-content', widgetContainer);
let relatedModuleName;
this.registerFilterForAddingModuleRelatedRecordFromSummaryWidget(widgetContainer);
Function registerEventForCopyAddress
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerEventForCopyAddress: function () {
let thisInstance = this;
this.formElement
.find(
'.js-toggle-panel:not(.inventoryHeader):not(.inventoryItems) .fieldValue, .js-toggle-panel:not(.inventoryHeader):not(.inventoryItems) .fieldLabel'