Showing 1,726 of 2,403 total issues
Method createImageFromObject
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
MediaFile $media_file,
float $x,
float $y,
float $w,
float $h,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $file, float $x, float $y, float $w, float $h, string $align, string $ln)
Method allMedia
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function allMedia(Tree $tree, string $folder, bool $subfolders, string $sort, string $filter, string $format): Collection
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::attributes($request)->isXref()->string('xref');
$xref2 = Validator::attributes($request)->isXref()->string('xref2', '');
- 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 compact
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
TreeViewHandler.prototype.compact = function () {
var tv = this;
var b = $('#tvbCompact', tv.toolbox);
tv.setLoading();
if (tv.auto_box_width) {
- 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 fillYData
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function fillYData($x, $z, $value, array $x_axis, array $z_axis, array &$ydata): void
Function loadChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function loadChildren(Family $family, int $generations): string
{
$out = '';
if ($family->canShow()) {
$children = $family->children();
- 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 buildNameFromParts
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
webtrees.buildNameFromParts = function (npfx, givn, spfx, surn, nsfx, sex) {
Function sitemapRecords
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function sitemapRecords(Tree $tree, string $type, int $limit, int $offset): Collection
{
switch ($type) {
case Family::RECORD_TYPE:
$records = $this->sitemapFamilies($tree, $limit, $offset);
- 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 recordsToFix
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function recordsToFix(Tree $tree, array $params): Collection
{
$families = $this->familiesToFix($tree, $params);
$individuals = $this->individualsToFix($tree, $params);
$locations = $this->locationsToFix($tree, $params);
- 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 getBlock
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
{
$num = (int) $this->getBlockSetting($block_id, 'num', self::DEFAULT_NUMBER_TO_SHOW);
extract($config, EXTR_OVERWRITE);
- 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 getPatriarchsHtml
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function getPatriarchsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std): string
Method drawPerson
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function drawPerson(Individual $person, int $gen, int $state, Family|null $pfamily, string $line, bool $isRoot): string
Method createNoteText
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function createNoteText(CensusInterface $census, string $ca_title, string $ca_place, string $ca_citation, array $ca_individuals, string $ca_notes): string
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
$style = Validator::attributes($request)->isInArrayKeys($this->styles())->string('style');
- 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 toUtf8
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function toUtf8(string $text): string
{
$utf8 = '';
foreach (str_split($text, 2) as $character) {
- 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
Avoid deeply nested control flow statements. Open
if ($first === 'bro' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 3));
}
Avoid deeply nested control flow statements. Open
switch ($event->tag()) {
case 'FAM:ANUL':
case 'FAM:DIV':
return I18N::translate('ex-husband');
case 'FAM:MARR':
Avoid deeply nested control flow statements. Open
if ($bef_last === 'mot') {
return I18N::translateContext('great ×(%s-1) grandmother’s brother', 'great ×%s uncle', I18N::number($up - 2));
}
Avoid deeply nested control flow statements. Open
if ($first === 'bro' && $sex1 === 'M') {
return I18N::translateContext('(a man’s) brother’s great ×(%s-1) granddaughter', 'great ×%s niece', I18N::number($down - 1));
}