Showing 1,726 of 2,403 total issues
Method queryRecords
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function queryRecords(): Collection
{
return DB::table('individuals')
->select([
new Expression('AVG(' . DB::prefix('death.d_julianday2') . ' - ' . DB::prefix('birth.d_julianday1') . ') / 365.25 AS age'),
Method significantIndividual
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function significantIndividual(UserInterface $user, string $xref = ''): Individual
{
if ($xref === '') {
$individual = null;
} else {
Function allMedia
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function allMedia(Tree $tree, string $folder, bool $subfolders, string $sort, string $filter, string $format): Collection
{
$query = DB::table('media')
->join('media_file', static function (JoinClause $join): void {
$join
- 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 findAxisEntry
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function findAxisEntry($value, array $axis)
{
if (is_numeric($value)) {
$value = (int) $value;
- 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 getPatriarchsHtml
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getPatriarchsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std): string
{
$html = '';
foreach ($individuals as $individual) {
foreach ($individual->childFamilies() as $family) {
- 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 updateTreeBlocks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function updateTreeBlocks(int $tree_id, Collection $main_block_ids, Collection $side_block_ids): void
{
$existing_block_ids = DB::table('block')
->where('gedcom_id', '=', $tree_id)
->whereIn('location', [ModuleBlockInterface::MAIN_BLOCKS, ModuleBlockInterface::SIDE_BLOCKS])
- 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 handle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
if ($request->getMethod() === RequestMethodInterface::METHOD_POST) {
$route = Validator::attributes($request)->route();
- 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 handle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$user = Validator::attributes($request)->user();
$user_id = Validator::parsedBody($request)->integer('user_id');
$username = Validator::parsedBody($request)->string('username');
- 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 updateUserBlocks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function updateUserBlocks(int $user_id, Collection $main_block_ids, Collection $side_block_ids): void
{
$existing_block_ids = DB::table('block')
->where('user_id', '=', $user_id)
->whereIn('location', [ModuleBlockInterface::MAIN_BLOCKS, ModuleBlockInterface::SIDE_BLOCKS])
- 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 mediaObjectInfo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. 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>';
- 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 __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(UploadedFileInterface|null $uploaded_file)
{
if ($uploaded_file === null) {
parent::__construct(I18N::translate('No file was received. Please try again.'));
- 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 render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function render($renderer): void
{
static $lastpicbottom, $lastpicpage, $lastpicleft, $lastpicright;
// Check for a pagebreak first
- 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 parseFacts
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function parseFacts(): array
{
// Split the record into facts
if ($this->gedcom !== '') {
$gedcom_facts = preg_split('/\n(?=1)/', $this->gedcom);
- 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 getChartAction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getChartAction(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
Method previousLink
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function previousLink(Individual $individual, string $style, int $generations): string
{
$icon = view('icons/arrow-' . self::MIRROR_STYLE[$style]);
$siblings = [];
Method alphabet
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function alphabet(): array
{
return [
'A',
'B',
Method getBlock
has 31 lines of code (exceeds 25 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);
Method alphabet
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function alphabet(): array
{
return [
'A',
'B',
Method getAdminEditAction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAdminEditAction(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/administration';
$block_id = Validator::queryParams($request)->integer('block_id', 0);