Showing 4,652 of 306,333 total issues
Function setSmtp
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function setSmtp(): void
{
if (!$this->smtp) {
throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
}
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
\App\Log::trace('Start ' . __METHOD__);
$qualifiedModule = $request->getModule(false);
$viewer = $this->getViewer($request);
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$result = false;
$fileContent = '';
if ($request->isEmpty('type') || $request->isEmpty('libraryName')) {
- 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 davSync
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function davSync(): int
{
$create = $updates = 0;
foreach ($this->davUsers as $userId => $user) {
$this->calendarId = $user->get('calendarsid');
- 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 getChartData
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getChartData()
{
$this->setUpModelFields();
if ('Table' === $this->chartType) {
return $this->getRows();
- 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 getRecords
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getRecords($user)
{
$this->initListViewController();
if (!$user) {
$user = App\User::getCurrentUserId();
- 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 registerCommentEvents
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerCommentEvents(detailContentsHolder) {
const self = this;
detailContentsHolder.on('click', '.js-close-comment-block', function (e) {
let commentInfoBlock = $(e.currentTarget.closest('.js-comment-single'));
commentInfoBlock.find('.js-comment-container').show();
Method getDetailViewLinks
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDetailViewLinks(array $linkParams): array
{
$recordModel = $this->getRecord();
$linkModelList = parent::getDetailViewLinks($linkParams);
unset($linkModelList['DETAIL_VIEW_ADDITIONAL']);
File RecordsList.js
has 308 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(
'Base_RecordsList_JS',
File Record.php
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Automatic Assignment Record Model Class.
*
Function registerTabEvents
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerTabEvents: function (contentContainer = $('.js-tab.active')) {
const self = this;
let mode = contentContainer.attr('id');
let table = this.registerDataTable(contentContainer);
table.off('click', '.js-details').on('click', '.js-details', function () {
Function registerListEvents
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerListEvents: function () {
const self = this;
let additional = this.container.find('.js-additional-informations').val() == 1;
self.container.on('click', '.js-select-row', function (e) {
if ($(e.target).hasClass('js-select-checkbox') || $(e.target).hasClass('u-cursor-auto')) {
Function registerInviteEvent
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerInviteEvent: function (editViewForm) {
this.registerRow(editViewForm);
let participantsContent = editViewForm.find('.js-participants-content');
let participantsSearch = editViewForm.find('.js-participants-search');
$.widget('custom.ivAutocomplete', $.ui.autocomplete, {
Function render
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var self = this;
this.$list = new ListWidget({
itemRenderer: function (li, value) {
Method importFont
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importFont($zipfile)
{
$fontsDir = ROOT_DIRECTORY . '/public_html/layouts/resources/fonts';
$zip = \App\Zip::openFile($zipfile, ['onlyExtensions' => ['ttf', 'txt', 'woff']]);
$files = $zip->unzip(['fonts' => $fontsDir]);
Method process
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
if (!$this->textParser->recordModel->getModule()->isInventory()) {
return $html;
Method getPrivilegeQuery
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getPrivilegeQuery(Db\Query $query, $moduleName, $user = false, $relatedRecord = null)
{
if ($user && $user instanceof User) {
$userId = $user->getId();
} elseif (!$user) {
Method process
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
if (!$this->textParser->recordModel->getModule()->isInventory()) {
return $html;
Method getDetailViewLinks
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDetailViewLinks(array $linkParams): array
{
$currentUserModel = \App\User::getCurrentUserModel();
$recordModel = $this->getRecord();
$recordId = $recordModel->getId();
Method getFreeTimeInDay
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFreeTimeInDay(string $day, string $activityType, int $ownerId = null)
{
$currentUser = empty($ownerId) ? \App\User::getCurrentUserModel() : \App\User::getUserModel($ownerId);
if (empty($activityType)) {
$activityType = $currentUser->get('defaultactivitytype');