Showing 4,652 of 306,333 total issues
Function isPermitted
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function isPermitted(string $moduleName, int $userId = null): bool
{
if (null === $userId) {
$userId = \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 validateHeaderServer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function validateHeaderServer(string $name, array $row, string $sapi)
{
unset($sapi);
$header = strtolower(\str_replace('Header: ', '', $name));
$onlyPhp = empty($row['onlyPhp']);
- 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 businessTime
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function businessTime(string $start, string $end, string $startHour, string $endHour, array $days, bool $holidays): int
{
$start = new \DateTime($start);
$end = new \DateTime($end);
$holidaysDates = $dates = [];
- 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 getImages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getImages(): array
{
if (null === self::$images) {
self::$images = [];
$dataReader = (new \App\Db\Query())->from(static::TABLE_NAME_MEDIA)->where(['status' => 1, 'fieldname' => 'image'])->createCommand()->query();
- 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 getProviders
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getProviders(): array
{
$return = [];
foreach (new \DirectoryIterator(ROOT_DIRECTORY . '/app/Extension/PwnedPassword/') as $item) {
if ($item->isFile() && 'Base' !== $item->getBasename('.php')) {
- 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 getCurrentRoom
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getCurrentRoom()
{
$recordId = $_SESSION['chat']['recordId'] ?? null;
$roomType = $_SESSION['chat']['roomType'] ?? null;
if (!isset($_SESSION['chat'])) {
- 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 validateHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function validateHeader(string $name, array $row, string $sapi)
{
unset($sapi);
$header = strtolower(\str_replace('Header: ', '', $name));
if (!empty($row['httpsRequired']) && !\App\RequestUtil::isHttps()) {
- 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 check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function check(): array
{
$result = [];
if (!\App\YetiForce\Shop::check('YetiForceVulnerabilities')) {
return $result;
- 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 relatedRecordsListPrinter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function relatedRecordsListPrinter(\Vtiger_RelationListView_Model $relationListView, \Vtiger_Paging_Model $pagingModel, int $maxLength): string
{
$relatedModuleName = $relationListView->getRelationModel()->getRelationModuleName();
$rows = '';
$fields = $relationListView->getHeaders();
- 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 getDataFromRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getDataFromRequest(\App\Request $request): array
{
$data = [];
foreach ($this->getCustomFields() as $fieldName => $fieldModel) {
if ($request->has($fieldName)) {
- 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 findCountryName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function findCountryName(string $value): string
{
if (empty($value)) {
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 formatToDisplay
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function formatToDisplay(?string $value): string
{
if (empty($value)) {
return '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 getModulesByUitype
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getModulesByUitype($uitype)
{
switch ($uitype) {
case 67:
$level = 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 getMembers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getMembers(): array
{
if (!$this->has('members')) {
$queryAll = null;
foreach (self::MEMBERS_TABLES as $tableName => $index) {
- 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 getUitypeByModule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getUitypeByModule($moduleName)
{
switch (static::getModuleLevel($moduleName)) {
case 0:
$return = 67;
- 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 getMappingRelatedField
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getMappingRelatedField($moduleName)
{
$return = false;
switch ((string) static::getModuleLevel($moduleName)) {
case '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 sanitizeDbFormat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function sanitizeDbFormat(string $time)
{
if ($time) {
$timeDetails = array_pad(explode(' ', $time), 2, '');
[$hours, $minutes, $seconds] = array_pad(explode(':', $timeDetails[0]), 3, '00');
- 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 getUsers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
{
\App\Log::trace("Entering getUsers($addBlank,$status,$private) method ...");
$tempResult = $this->initUsers($status, $assignedUser, $private, $roles);
- 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 getFieldsForListFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getFieldsForListFilter(string $moduleName): array
{
$fields = [];
$moduleId = \App\Module::getModuleId($moduleName);
foreach (static::getHierarchyByRelation() as $relations) {
- 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 getDependencyForModule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getDependencyForModule(string $moduleName)
{
if (\App\Cache::has('Picklist::getDependencyForModule', $moduleName)) {
return \App\Cache::get('Picklist::getDependencyForModule', $moduleName);
}
- 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"