Showing 1,726 of 2,403 total issues
Function canShowRecord
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
private function canShowRecord(int $access_level): bool
{
// This setting would better be called "$ENABLE_PRIVACY"
if (!$this->tree->getPreference('HIDE_LIVE_PEOPLE')) {
return true;
- 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 starredName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
private static function starredName(string $textSpan, string $direction): string
{
// To avoid a TCPDF bug that mixes up the word order, insert those <u> and </u> tags
// only when page and span directions are identical.
if ($direction === strtoupper(I18N::direction())) {
- 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
Method alphabet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
UTF8::CYRILLIC_CAPITAL_LETTER_A,
UTF8::CYRILLIC_CAPITAL_LETTER_BE,
Method alphabet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
UTF8::CYRILLIC_CAPITAL_LETTER_A,
UTF8::CYRILLIC_CAPITAL_LETTER_BE,
Method getBlock
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
{
$statistics = Registry::container()->get(Statistics::class);
$num = $this->getBlockSetting($block_id, 'num', self::DEFAULT_NUMBER);
$infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE);
Method alphabet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
UTF8::CYRILLIC_CAPITAL_LETTER_A,
UTF8::CYRILLIC_CAPITAL_LETTER_BE,
Method alphabet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
'А',
'Б',
Method handle
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::attributes($request)->isXref()->string('xref');
$fact_id = Validator::attributes($request)->string('fact_id');
Method mediaObjectInfo
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function mediaObjectInfo(Media $media): string
{
$element = Registry::elementFactory()->make('NOTE:CONC');
$html = '<a href="' . e($media->url()) . '" title="' . e($media->tree()->title()) . '">' . $media->fullName() . '</a>';
Method handle
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
Method columns
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function columns(): array
{
return [
new CensusColumnFullName($this, 'Name', 'Name of each person in family, household or institution'),
new CensusColumnNull($this, 'Sec/Twp', 'Place of Abode (Section or Township)'),
Method textScript
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function textScript(string $string): string
{
$string = strip_tags($string); // otherwise HTML tags show up as latin
$string = html_entity_decode($string, ENT_QUOTES, 'UTF-8'); // otherwise HTML entities show up as latin
$string = str_replace([
Method facts
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function facts(
array $filter = [],
bool $sort = false,
int|null $access_level = null,
bool $ignore_deleted = false
Method addAncestors
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addAncestors(array &$list, string $pid, bool $children = false, int $generations = -1): void
{
$genlist = [$pid];
$list[$pid]->generation = 1;
while (count($genlist) > 0) {
Method connect
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
#[SensitiveParameter]
string $driver,
#[SensitiveParameter]
string $host,
#[SensitiveParameter]
Method alphabet
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
'A',
'B',
Method alphabet
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
'A',
'B',
Method alphabet
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
UTF8::CYRILLIC_CAPITAL_LETTER_A,
UTF8::CYRILLIC_CAPITAL_LETTER_BE,
Method postAdminEditAction
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function postAdminEditAction(ServerRequestInterface $request): ResponseInterface
{
$block_id = Validator::queryParams($request)->integer('block_id', 0);
$body = Validator::parsedBody($request)->string('body');
$header = Validator::parsedBody($request)->string('header');
Method alphabet
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function alphabet(): array
{
return [
UTF8::ARABIC_LETTER_ALEF,
UTF8::ARABIC_LETTER_BEH,