Showing 4,652 of 306,333 total issues
Function getHierarchyData
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
{
\App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
$currentUser = Users_Privileges_Model::getCurrentUserModel();
$hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
- 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 getListSearchParams
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
getListSearchParams: function (urlSearchParams) {
let listViewPageDiv = this.getContainer();
let listViewTable = listViewPageDiv.find('.listViewEntriesTable');
let searchParams = [];
listViewTable.find('.listSearchContributor').each(function (index, domElement) {
Method getAllByType
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getAllByType($tabid, $type = false, $parameters = false)
{
if (\App\Cache::has('AllLinks', 'ByType')) {
$rows = \App\Cache::get('AllLinks', 'ByType');
} else {
Method initializeListViewContents
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
{
$moduleName = $request->getModule();
$pageNumber = $request->getInteger('page');
$orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
Settings_LayoutEditor_Module_Model
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
{
/** {@inheritdoc} */
public $name = 'LayoutEditor';
/** @var string Parent name */
Vtiger_RelationListView_Model
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Vtiger_RelationListView_Model extends \App\Base
{
/**
* Relation model instance.
*
Method process
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
$relationModuleName = 'Products';
// Products from main storage
Function _request
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
_request: function (params, pjaxMode, rawData) {
const aDeferred = jQuery.Deferred();
if (typeof rawData === 'undefined') {
rawData = false;
}
Method checkZip
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkZip($zipfile)
{
$manifestFound = $languagefile_found = $layoutfile_found = $updatefile_found = $extensionfile_found = $moduleVersionFound = $fontfile_found = false;
$moduleName = null;
$zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
Method getDetailViewRelatedLinks
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDetailViewRelatedLinks()
{
$recordModel = $this->getRecord();
$moduleName = $recordModel->getModuleName();
$parentModuleModel = $this->getModule();
Method getListViewMassActions
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getListViewMassActions($linkParams)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleModel = $this->getModule();
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
Method isPermitted
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function isPermitted(string $moduleName, $actionName = null, $record = false, $userId = false)
{
if (!$userId) {
$user = \App\User::getCurrentUserModel();
} else {
File Workflow.php
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* +**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
File Iframe.js
has 337 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';
window.MailIntegration_Iframe = {
mailId: 0,
File Record.php
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* OSSMailView record model class.
*
Function mapResultsToFields
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
mapResultsToFields: function (referenceModule, parentRow, responseData) {
let unit,
taxParam = [];
let thisInstance = this;
let isGroupTax = thisInstance.isGroupTaxMode();
- 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 sanitizeInventoryValues
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function sanitizeInventoryValues(array $inventoryRow, array $inventoryFields): array
{
$inventoryEntries = [];
foreach ($inventoryFields as $columnName => $field) {
$value = $inventoryRow[$columnName];
- 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 parseAdvFilter
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function parseAdvFilter($advFilterList = false)
{
if (!$advFilterList) {
$advFilterList = $this->advFilterList;
}
- 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 import
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function import(): bool
{
$allChecked = false;
try {
if ($orders = $this->getOrdersFromApi()) {
- 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 getDenormalizedData
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function getDenormalizedData($calendarData)
{
$vObject = VObject\Reader::read($calendarData);
$uid = $lastOccurence = $firstOccurence = $component = $componentType = null;
foreach ($vObject->getComponents() as $component) {
- 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"