Showing 4,652 of 306,333 total issues
Function getFileFromImage
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private function getFileFromImage(DOMElement $element, array $params, array &$attachments): array
{
$src = trim($element->getAttribute('src'), '\'');
$element->removeAttribute('src');
$file = [];
- 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 isLockByFields
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function isLockByFields()
{
if (!isset($this->privileges['isLockByFields'])) {
$isLock = false;
$moduleName = $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 initializeContent
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function initializeContent(App\Request $request)
{
$viewer = $this->getViewer($request);
$this->moduleName = $request->getModule();
$this->sourceModule = $request->getByType('src_module', 2);
- 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 setRelatedFieldsInHierarchy
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function setRelatedFieldsInHierarchy(Vtiger_Record_Model $recordModel, $fieldName)
{
$fieldValue = $recordModel->get($fieldName);
$relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);
if ($relatedModules && !empty($fieldValue) && $recordModel->getPreviousValue($fieldName) !== $fieldValue) {
- 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 31 (exceeds 5 allowed). Consider refactoring. Open
public function read()
{
$defaultCharset = App\Config::main('default_charset');
$this->createTable();
- 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 createQuery
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function createQuery(): void
{
$this->queryGenerator = new \App\QueryGenerator('Users');
$limit = 1000;
if ($requestLimit = $this->controller->request->getHeader('x-row-limit')) {
- 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 Field.php
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App;
/**
Method process
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
if (!$this->textParser->recordModel->getModule()->isInventory()) {
return $html;
File RelationAjax.php
has 355 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
OSSMailScanner_Record_Model
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class OSSMailScanner_Record_Model extends Vtiger_Record_Model
{
/**
* Main folders array.
*
Vtiger_Inventory_Model
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Vtiger_Inventory_Model
{
/**
* Field configuration table postfix.
*/
File Profiles.js
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*+*******************************************************************************
* 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
* The Initial Developer of the Original Code is vtiger.
File ListPreview.js
has 351 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';
Vtiger_List_Js(
'Vtiger_ListPreview_Js',
File Field.js
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*+***********************************************************************************
* 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
* The Initial Developer of the Original Code is vtiger.
File ChatAjax.php
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Action to get Chat data.
*
Function sanitizeFieldMapping
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
sanitizeFieldMapping: function () {
var fieldsList = jQuery('.fieldIdentifier');
var mappedFields = {};
var inventoryMappedFields = {};
var errorMessage;
- 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 getViewId
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function getViewId($noCache = false)
{
\App\Log::trace(__METHOD__);
if (isset($this->defaultViewId)) {
return $this->defaultViewId;
- 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 getVendorLibraries
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public static function getVendorLibraries()
{
$libraries = [];
if (file_exists(ROOT_DIRECTORY . '/composer.lock')) {
$composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), 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 process
has a Cognitive Complexity of 30 (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 getSupportedCurrencies
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function getSupportedCurrencies()
{
$supportedCurrencies = [];
$supportedCurrencies[Settings_CurrencyUpdate_Module_Model::getCRMCurrencyName($this->getMainCurrencyCode())] = $this->getMainCurrencyCode();
$dateCur = date('Y-m-d', strtotime('last monday'));
- 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"