Showing 4,652 of 306,333 total issues
Function loadSearchLockedFields
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function loadSearchLockedFields(App\Request $request): void
{
$moduleModel = $this->getRelationModel()->getRelationModuleModel();
if (!$request->isEmpty('lockedFields')) {
foreach ($request->getArray('lockedFields') as $value) {
- 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 findOutColorsFromRows
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function findOutColorsFromRows()
{
if ($this->areColorsFromFilter()) {
return 'filters';
}
- 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 getModalRecordsListFields
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getModalRecordsListFields(App\QueryGenerator $queryGenerator, $sourceModule = false)
{
if (App\Cache::staticHas('PopupViewFieldsList', $this->getName())) {
$popupFields = App\Cache::staticGet('PopupViewFieldsList', $this->getName());
} else {
- 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 checkPermission
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function checkPermission(): void
{
parent::checkPermission();
$moduleName = $this->controller->request->getModule();
if ('POST' === $this->controller->method) {
- 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 Card.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CardDav address books file.
*
* @see https://en.wikipedia.org/wiki/VCard#Properties
Function registerButtons
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerButtons: function (container) {
container.find('.js-test-speed').on('click', function () {
let progress = jQuery.progressIndicator({
message: app.vtranslate('JS_SPEED_TEST_START'),
position: 'html',
Function registerMassActionEvent
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerMassActionEvent(container) {
let thisInstance = this;
$('.masscopy', container).click((e) => {
let isChecked = $('.mass-selector', container).is(':checked');
if (isChecked) {
Function registerOnChangeEventOfTargetModule
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerOnChangeEventOfTargetModule: function () {
var form = jQuery('#leadsMapping');
form.on('change', 'select.accountsFields.select2,select.contactFields.select2', function (e, executeChange) {
if (typeof executeChange === 'undefined') {
executeChange = true;
Function registerSplitEvents
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerSplitEvents: function (container, split) {
var rightSplitMaxWidth = (400 / this.windowW) * 100;
var minWindowWidth = (25 / this.windowW) * 100;
var maxWindowWidth = 100 - minWindowWidth;
var listPreview = container.find('.js-detail-preview');
Function registerSplitEvents
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerSplitEvents: function (container, split) {
let rightSplitMaxWidth = (400 / this.windowW) * 100;
let minWindowWidth = (23 / this.windowW) * 100;
let maxWindowWidth = 100 - minWindowWidth;
let listPreview = container.find('.js-detail-preview');
Function submit
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
submit() {
let moduleName = app.getModuleName(),
recordId = app.getRecordId();
if (this.modal.find('[name="sourceModule"]').length > 0) {
moduleName = this.modal.find('[name="sourceModule"]').val();
Function saveAjaxValidation
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
saveAjaxValidation: function (params) {
const aDeferred = $.Deferred();
if (this.getInstance().checkPreSaveValidation()) {
let paramsTemp = JSON.parse(JSON.stringify(params));
paramsTemp.data.mode = 'preSaveValidation';
Function show
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.show = function () {
var className = 'bigLoading';
if (this.options.smallLoadingImage == true) {
className = 'smallLoading';
}
Function onShow
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
onShow: function () {
this.getContentElement('tab-source', 'file')
.getInputElement()
.$.setAttribute('accept', 'image/jpeg, image/png, image/gif');
/* Remove preview */
Function registerPostLoadEvents
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerPostLoadEvents(form, params, element) {
const submitSuccessCallback = params.callbackFunction || function () {};
const goToFullFormCallBack = params.goToFullFormcallback || function () {};
form.on('submit', (e) => {
if (form.hasClass('not_validation')) {
Method importUpdate
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importUpdate()
{
$dirName = 'cache/updates/updates';
$db = \App\Db::getInstance();
$startTime = microtime(true);
Method testAdvancedConditions
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAdvancedConditions()
{
$moduleName = 'Accounts';
$accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
$contactId = \Tests\Base\C_RecordActions::createContactRecord()->getId();
Method parseParams
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseParams(array $params)
{
foreach ($params as $param => $value) {
switch ($param) {
case 'margin-top':
Method recalculateSharingRulesByUser
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function recalculateSharingRulesByUser($id)
{
$userModel = \App\User::getUserModel($id);
if (!$userModel->getId()) {
return null;
Method getDisplayValue
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDisplayValue($name)
{
$value = $this->get($name);
switch ($name) {
case 'server_id':