Showing 1,726 of 2,403 total issues
Method __construct
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(array|int|AbstractCalendarDate $date)
{
// Construct from an integer (a julian day number)
if (is_int($date)) {
$this->minimum_julian_day = $date;
Method labelValue
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function labelValue(string $value, Tree $tree): string
{
$id = Registry::idFactory()->id();
$expanded = $tree->getPreference('EXPAND_NOTES') === '1';
Method allMedia
has 49 lines of code (exceeds 25 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
Method handle
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$parent_id = Validator::parsedBody($request)->string('parent_id');
$place_id = Validator::parsedBody($request)->string('place_id');
$latitude = Validator::parsedBody($request)->string('new_place_lati');
Method handle
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$title = Validator::parsedBody($request)->isNotEmpty()->string('source-title');
$abbreviation = Validator::parsedBody($request)->string('source-abbreviation');
Method centuryName
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function centuryName(int $century): string
{
if ($century < 0) {
return I18N::translate('%s BCE', $this->centuryName(-$century));
}
Method setVarStartHandler
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setVarStartHandler(array $attrs): void
{
if (empty($attrs['name'])) {
throw new DomainException('REPORT ERROR var: The attribute "name" is missing or not set in the XML file');
}
Method leafletJsTileLayers
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function leafletJsTileLayers(): array
{
$api_key = $this->getPreference('api_key');
return [
Method handle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
$xref = Validator::attributes($request)->isXref()->string('xref');
Method uploadFile
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function uploadFile(ServerRequestInterface $request): string
{
$tree = Validator::attributes($request)->tree();
$file_location = Validator::parsedBody($request)->string('file_location');
Method importMissingLocations
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importMissingLocations(): void
{
$all_places = DB::table('places AS p0')
->leftJoin('places AS p1', 'p1.p_id', '=', 'p0.p_parent_id')
->leftJoin('places AS p2', 'p2.p_id', '=', 'p1.p_parent_id')
Method handle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->layout = 'layouts/setup';
// Some functions need a cache, but we don't have one yet.
Method handle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$data_filesystem = Registry::filesystem()->data();
$all_folders = $this->media_file_service->allMediaFolders($data_filesystem);
Method handle
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$token = $request->getAttribute('token');
$tree = Validator::attributes($request)->treeOptional();
$username = $request->getAttribute('username');
Method addDescendancy
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addDescendancy(&$list, $pid, $parents = false, $generations = -1): void
{
$person = Registry::individualFactory()->make($pid, $this->tree);
if ($person === null) {
return;
Function summary
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function summary(): string
{
$attributes = [];
$target = $this->target();
if ($target instanceof GedcomRecord) {
- 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 individuals
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function individuals(Tree $tree, array $surns_to_show, string $galpha, bool $marnm, bool $fams): Collection
{
$query = DB::table('individuals')
->join('name', 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 getFactsWithSources
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function getFactsWithSources(Individual $individual): Collection
{
if ($this->facts === null) {
$facts = $individual->facts();
- 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 chr
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function chr(int $code): string
{
if ($code < 0 || $code > 0x1FFFFF) {
throw new InvalidArgumentException((string)$code);
}
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$delete_default_resn_id = Validator::parsedBody($request)->array('delete');
- 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"