Showing 4,652 of 306,333 total issues
Method process
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$dbCommand = App\Db::getInstance()->createCommand();
$scannerModel = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
$dataReader = (new App\Db\Query())->select([
Method getFieldInstanceByName
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
$params = [];
switch ($name) {
case 'groupname':
Method getDetailViewLinks
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDetailViewLinks(array $linkParams): array
{
$linkModelList = parent::getDetailViewLinks($linkParams);
$recordModel = $this->getRecord();
$moduleName = $recordModel->getModuleName();
Function addTimeControl
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
addTimeControl: function (params) {
let aDeferred = jQuery.Deferred();
let referenceModuleName = 'OSSTimeControl';
let parentId = params.recordId;
let parentModule = 'HelpDesk';
Function addTimeControl
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
addTimeControl(params, callback = () => {}) {
let aDeferred = jQuery.Deferred();
let referenceModuleName = 'OSSTimeControl';
let parentId = params.recordId;
let parentModule = 'HelpDesk';
Method relatedRecord
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function relatedRecord($params)
{
$params = explode('|', $params);
$fieldName = array_shift($params);
$relatedField = array_shift($params);
Method recalculatePasswords
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function recalculatePasswords(string $method, string $password, string $vector, int $target)
{
$dbAdmin = \App\Db::getInstance('admin');
$decryptInstance = static::getInstance($target);
if (!$decryptInstance->getTarget() || ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password)) {
Method process
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$recordId = $request->getInteger('id');
$workflowModel = Settings_Workflows_Record_Model::getInstance($recordId);
$workflowObject = $workflowModel->getWorkflowObject();
Method read
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read()
{
$this->createTable();
$fieldMapping = $this->request->get('field_mapping');
$inventoryFieldMapping = $this->request->get('inventory_field_mapping');
Method getGanttTasks
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getGanttTasks($projectIds)
{
$taskTime = 0;
$queryGenerator = new App\QueryGenerator('ProjectTask');
$queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
Function formatToDisplay
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
formatToDisplay(value, fixed = true, numberOfDecimal = CONFIG.noOfCurrencyDecimals) {
if (!value) {
value = 0;
}
let strDecimal = value.toString().split('.')[1];
- 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 emit
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function emit()
{
$contentTypeSent = false;
foreach ($this->headers as $header) {
if (!$contentTypeSent && 0 === stripos($header, 'content-type')) {
- 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 purify
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function purify($input, $loop = true)
{
if (empty($input)) {
return $input;
}
- 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 removeFieldFromCondition
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
{
if (isset($conditions['rules'])) {
foreach ($conditions['rules'] as $key => &$condition) {
if (isset($condition['condition'])) {
- 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 findByEmailField
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function findByEmailField(string $moduleName, array $fields, array $emails): array
{
$activeFields = $conditions = $return = [];
foreach ($emails as $i => $email) {
if (isset(self::$emailsCache[$moduleName][$email])) {
- 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 19 (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 findIpByName
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function findIpByName(\ZBateson\MailMimeParser\Header\ReceivedHeader $received, string $type): string
{
$value = $received->getValueFor($type);
$pattern = '~\[(IPv[64])?([a-f\d\.\:]+)\]~i';
if (preg_match($pattern, $value, $matches)) {
- 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 init
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private static function init(string $type)
{
if (\App\Config::main('site_URL')) {
static::$crmUrl = \App\Config::main('site_URL');
} elseif (isset(\App\Process::$requestMode) && 'Install' === \App\Process::$requestMode) {
- 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 saveToDb
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function saveToDb(): bool
{
$db = \App\Db::getInstance();
$result = false;
$fieldName = $this->fieldModel->getName();
- 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 import
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function import(): bool
{
$allChecked = false;
try {
if ($categories = $this->getCategoriesFromApi()) {
- 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"