Showing 4,652 of 306,333 total issues
Method preProcessAjax
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preProcessAjax(App\Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$sourceModule = $request->getByType('sourceModule', 2);
Method process
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$moduleModel = Vtiger_Module_Model::getInstance($request->getModule());
$primaryRecord = $request->getInteger('record');
$migrate = [];
Method process
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
foreach (\App\SystemWarnings::getWarnings('all') as $warning) {
if ('YetiForce' === $warning->getFolder()) {
Method get
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get(App\Request $request)
{
if ($request->isEmpty('key', 2)) {
throw new \App\Exceptions\NoPermitted('Not Acceptable', 406);
}
Method saveHistory
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function saveHistory($title)
{
if (empty(App\User::getCurrentUserId())) {
return false;
}
Method getImportDetails
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getImportDetails(App\User $user, $forModule)
{
$db = App\Db::getInstance();
$importRecords = [];
$tableName = Import_Module_Model::getDbTableName($user);
Method add
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function add(App\Request $request, App\User $user)
{
if ($request->get('is_scheduled')) {
$temp_status = self::$IMPORT_STATUS_SCHEDULED;
} else {
Method getFilterFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFilterFields($moduleName): array
{
if (!isset($this->filterFields)) {
$this->filterFields = [];
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
Method get
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get(): array
{
$parentId = \App\Record::getParentRecord($this->getUserCrmId());
if (\in_array($this->getPermissionType(), [\Api\WebservicePremium\Privilege::ACCOUNTS_RELATED_RECORDS_IN_HIERARCHY, \Api\WebservicePremium\Privilege::ACCOUNTS_RELATED_RECORDS_AND_LOWER_IN_HIERARCHY])) {
$fields = \App\Field::getRelatedFieldForModule($this->moduleName);
Method get
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get(): array
{
$limit = 50;
if ($requestLimit = $this->controller->request->getHeader('x-row-limit')) {
$limit = (int) $requestLimit;
Method checkAccess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkAccess(): void
{
$db = \App\Db::getInstance('webservice');
$userData = (new \App\Db\Query())->from($this->controller->app['tables']['user'])
->where(['server_id' => $this->controller->app['id'], 'user_name' => $this->controller->request->get('userName'), 'status' => 1])
Method preProcess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preProcess(): bool
{
register_shutdown_function(function () {
if ($error = error_get_last()) {
$this->errorHandler($error['type'], $error['message'], $error['file'], $error['line']);
Function registerUserList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function registerUserList() {
var selectUsers = $('.js-header__btn--mail select');
if (selectUsers.data('select2')) {
selectUsers.select2('destroy');
} 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 widgetRelatedRecordView
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
widgetRelatedRecordView: function (container, load) {
let cacheKey = this.getRecordId() + '_' + container.data('id');
let relatedRecordCacheID = app.moduleCacheGet(cacheKey);
if (relatedRecordCacheID !== null) {
let newActive = container.find(".js-carousel-item[data-id = '" + relatedRecordCacheID + "']");
- 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 toggleTimesInputs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
toggleTimesInputs: function (container) {
container.find(':checkbox').on('change', function () {
var checkboxName = $(this).attr('name');
if ('allday' == checkboxName) {
var checkboxIsChecked = $(this).is(':checked');
- 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 changeCustomFilterElementView
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
changeCustomFilterElementView: function () {
const thisInstance = this;
let filterSelectElement = this.getFilterSelectElement();
if (filterSelectElement.length > 0 && filterSelectElement.is('select')) {
App.Fields.Picklist.showSelect2ElementView(filterSelectElement, {
- 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 calculatePages
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
calculatePages: function () {
let aDeferred = $.Deferred();
let element = $('#totalPageCount');
let totalPageNumber = element.text();
if (totalPageNumber == '') {
- 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 jumpToPage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
jumpToPage(e) {
const self = this,
listViewPageDiv = this.getListViewContainer();
if (13 === e.which) {
e.stopImmediatePropagation();
- 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 getFieldSpecificUi
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
getFieldSpecificUi: function (fieldSelectElement) {
let fieldModel = this.fieldModelInstance,
html;
if (fieldModel.get('comparatorElementVal') === 'd') {
html = '<div class="checkbox"><label><input type="checkbox" name="' + fieldModel.getName() + '" value="0" ';
- 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 exportSharingAccess
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function exportSharingAccess(ModuleBasic $moduleInstance)
{
$permission = (new \App\Db\Query())->select(['permission'])->from('vtiger_def_org_share')->where(['tabid' => $moduleInstance->id])->column();
if (empty($permission)) {
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"