Showing 4,652 of 306,333 total issues
File DateTimeRange.php
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Date time range class.
*
* @copyright YetiForce S.A.
Function registerRange
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerRange(parentElement, customParams = {}) {
if (typeof parentElement === 'undefined') {
parentElement = $('body');
} else {
parentElement = $(parentElement);
Method doTask
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doTask($recordModel)
{
$moduleName = $recordModel->getModuleName();
$recordId = $recordModel->getId();
$entityType = $this->entity_type;
Method getProject
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getProject($id, $viewName = null)
{
if (!\is_array($id) && isset($this->tasksById[$id])) {
return [$this->tasksById[$id]];
}
Vtiger_Calendar_Js
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
window.Vtiger_Calendar_Js = class Vtiger_Calendar_Js extends Calendar_Js {
/**
* Create calendar's options.
* @param {jQuery} container
* @param {bool} readonly
RecordConverter
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class RecordConverter extends Base
{
/** @var int Field to mapping */
const FIELD_TO_MAPPING = 1;
BaseField
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseField
{
/**
* @var \App\QueryGenerator
*/
Base
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Base
{
/** @var string Driver name */
const DRIVER_NAME = self::DRIVER_NAME;
Vtiger_PDF_Model
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Vtiger_PDF_Model extends \App\Base
{
/**
* Template type standard.
*
Function registerAutoloadAddress
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerAutoloadAddress: function () {
const self = this;
this.getForm()
.find('.js-search-address')
.each(function (_index, e) {
Method process
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
if (!$this->textParser->recordModel->getModule()->isInventory()) {
return $html;
Method getFieldInstanceByName
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
$moduleName = 'Settings:WidgetsManagement';
$field = $this->getEditFields()[$name] ?? null;
if (!$field) {
Method get
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get(): array
{
$pagingModel = new \Vtiger_Paging_Model();
$limit = 100;
$isMorePages = false;
Function refreshWidget
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
refreshWidget: function refreshWidget() {
let thisInstance = this;
let parent = this.getContainer();
let element = parent.find('.js-widget-refresh');
let url = element.data('url');
Function registerSearchCompany
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerSearchCompany: function () {
const searchValue = this.container.find('.js-search-company');
const searchModule = this.container.find('.searchModule');
$.widget('custom.ivAutocomplete', $.ui.autocomplete, {
_create: function () {
Method getListViewMassActions
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getListViewMassActions($linkParams)
{
$moduleModel = $this->getModule();
$moduleName = $moduleModel->getName();
Function copyAddress
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
copyAddress: function (fromLabel, toLabel, relatedRecord, sourceModule) {
const thisInstance = this;
let formElement = this.getForm(),
status = false,
addressMapping = this.addressFieldsMapping,
- 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 getSearchLabelQuery
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchLabelQuery(): Db\Query
{
$query = (new Db\Query())->select(['csl.crmid', 'setype' => 'vtiger_tab.name', 'csl.searchlabel'])
->from('u_#__crmentity_search_label csl')
->innerJoin('vtiger_tab', 'csl.tabid = vtiger_tab.tabid')
- 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()
{
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 getUsersAndGroupForModuleList
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
{
$queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
if ($view) {
$queryGenerator->initForCustomViewById($view);
- 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"