Showing 1,726 of 2,403 total issues
Method getBlock
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
{
$individual = $tree->significantIndividual(Auth::user());
$links = [];
Method getTabContent
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTabContent(Individual $individual): string
{
// Which facts and events are handled by other modules?
$sidebar_facts = $this->module_service
->findByComponent(ModuleSidebarInterface::class, $individual->tree(), Auth::user())
Method recordsToFix
has 36 lines of code (exceeds 25 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);
Method alphabet
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function alphabet(): array
{
return [
'A',
'B',
Method getRecentChangesFromGenealogy
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getRecentChangesFromGenealogy(Tree $tree, int $days): Collection
{
$julian_day = Registry::timestampFactory()->now()->subtractDays($days)->julianDay();
$individuals = DB::table('dates')
Method layoutIndividuals
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function layoutIndividuals(array $individuals): array
{
$color_generators = [
'M' => new ColorGenerator(240, self::SATURATION, self::LIGHTNESS, self::ALPHA, self::RANGE * -1),
'F' => new ColorGenerator(000, self::SATURATION, self::LIGHTNESS, self::ALPHA, self::RANGE),
Method deliverMessage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deliverMessage(UserInterface $sender, UserInterface $recipient, string $subject, string $body, string $url, string $ip): bool
{
$success = true;
// Temporarily switch to the recipient's language
Method handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$firstname = Validator::queryParams($request)->string('firstname', '');
$lastname = Validator::queryParams($request)->string('lastname', '');
Method handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$parent_id = $request->getAttribute('parent_id');
if ($parent_id === null) {
Method edit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit(string $id, string $name, string $value, Tree $tree): string
{
$submitter_text = new SubmitterText('');
$xref_note = new XrefNote('');
Method __construct
has 36 lines of code (exceeds 25 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.'));
Method varStartHandler
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function varStartHandler(array $attrs): void
{
if (empty($attrs['var'])) {
throw new DomainException('REPORT ERROR var: The attribute "var=" is missing or not set in the XML file on line: ' . xml_get_current_line_number($this->parser));
}
Function typeComparator
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function typeComparator(): Closure
{
static $factsort = [];
if ($factsort === []) {
- 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 uploadFile
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function uploadFile(ServerRequestInterface $request): string
{
$tree = Validator::attributes($request)->tree();
$file_location = Validator::parsedBody($request)->string('file_location');
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$parent_id = $request->getAttribute('parent_id');
if ($parent_id === null) {
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$view = Validator::attributes($request)->isInArray(['day', 'month', 'year'])->string('view');
$cal = Validator::queryParams($request)->string('cal', '');
- 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 sosaStradonitzAncestors
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function sosaStradonitzAncestors(Individual $individual, int $generations): Collection
{
$ancestors = [1 => $individual];
$queue = [1];
- 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 write
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function write(string $id, string $data): bool
{
$ip_address = Validator::attributes($this->request)->string('client-ip');
$user_id = (int) Auth::id();
$now = Registry::timestampFactory()->now();
- 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 utf8WordWrap
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function utf8WordWrap(string $string, int $width): string
{
$out = '';
while ($string) {
if (mb_strlen($string) <= $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
Function getSecondaryName
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getSecondaryName(): int
{
if ($this->getSecondaryName === null) {
// Generally, the primary and secondary names are the same
$this->getSecondaryName = $this->getPrimaryName();
- 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"