Showing 4,652 of 306,333 total issues
Function getStructure
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getStructure()
{
if (!empty($this->structuredValues)) {
return $this->structuredValues;
}
- 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 loadFieldValuesFromSource
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function loadFieldValuesFromSource(App\Request $request): array
{
$fieldValues = [];
$sourceRelatedField = $this->recordModel->getModule()->getValuesFromSource($request);
foreach ($sourceRelatedField as $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 uploadAndParse
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function uploadAndParse(App\Request $request)
{
if (Import_Utils_Helper::validateFileUpload($request)) {
$user = App\User::getCurrentUserModel();
$fileReader = Import_Module_Model::getFileReader($request, $user);
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
if ($request->isAjax()) {
- 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 16 (exceeds 5 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');
- 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 helpDeskNewCommentOwner
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function helpDeskNewCommentOwner(Vtiger_Record_Model $recordModel)
{
\App\Log::trace('Entering helpDeskNewCommentOwner');
$relatedToId = $recordModel->get('related_to');
$result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();
- 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 16 (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('Project', '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 getInventoryData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getInventoryData(): array
{
$inventoryData = [];
foreach ($this->inventory as $inventoryKey => $inventoryItem) {
foreach (\Vtiger_Inventory_Model::getInstance($this->moduleName)->getFields() as $columnName => $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 getChild
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getChild(int $id, array &$childRow, int $depthBase): array
{
\App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
\App\Log::error('Exiting getChild 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 showEditView
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
showEditView: function (id) {
var thisInstance = this;
var aDeferred = jQuery.Deferred();
var progressIndicatorElement = jQuery.progressIndicator({
Function registerUserList
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerUserList() {
var selectUsers = $('.js-header__btn--mail select');
if (selectUsers.data('select2')) {
selectUsers.select2('destroy');
} else {
Function registerMassRecordsEvents
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerMassRecordsEvents: function () {
const self = this;
self.getRelatedContainer().on('click', '.js-mass-record-event', function () {
let target = $(this);
if (self.checkListRecordSelected() !== true) {
Function registerChangeTaxModal
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerChangeTaxModal: function (modal, parentRow, params) {
let thisInstance = this;
let form = modal.find('form');
form.validationEngine(app.validationEngineOptions);
modal.on('change', '.individualTaxType', function (e) {
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
this.$list = new ListWidget({
itemRenderer: function (li, e) {
$('<span />').addClass(csscls('message')).text(e.message).appendTo(li);
if (e.file) {
Function init
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (editor) {
if (editor.addFeature) {
editor.addFeature({
allowedContent: 'img[alt,id,!src]{width,height};'
});
Function showModalData
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
showModalData(data, container, paramsObject, cb, url, sendByAjaxCb) {
const thisInstance = this;
let params = {
show: true
};
Method testAddConfiguration
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAddConfiguration(): void
{
$app = \Settings_WebserviceApps_Record_Model::getCleanInstance();
$app->set('type', 'WebservicePremium');
$app->set('status', 1);
Method getConfig
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getConfig()
{
$php = [];
foreach (ini_get_all() as $key => $value) {
$php[$key] = $value['local_value'];
Method find
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function find($value): array
{
if (empty($value) || !\App\RequestUtil::isNetConnection()) {
return [];
}
Method process
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$type = $request->getByType('type');
if (!isset(\App\Log::$logsViewerColumnMapping[$type])) {
throw new \App\Exceptions\NoPermittedForAdmin('ERR_ILLEGAL_VALUE');