Showing 1,726 of 2,403 total issues
Method fromUtf8
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fromUtf8(string $text): string
{
$out = '';
$len = strlen($text);
Method columns
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function columns(): array
{
return [
new CensusColumnFullName($this, 'Name', 'Name'),
new CensusColumnRelationToHeadEnglish($this, 'Relation', 'Relationship of each person to the head of the family'),
Method parseFacts
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseFacts(): array
{
// Split the record into facts
if ($this->gedcom !== '') {
$gedcom_facts = preg_split('/\n(?=1)/', $this->gedcom);
Method topTenOldestAliveQuery
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function topTenOldestAliveQuery(string $sex, int $total): array
{
$query = DB::table('dates')
->join('individuals', static function (JoinClause $join): void {
$join
Method topSurnames
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function topSurnames(int $number_of_surnames, int $threshold): array
{
// Use the count of base surnames.
$top_surnames = DB::table('name')
->where('n_file', '=', $this->tree->id())
Method ageBetweenSiblingsList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function ageBetweenSiblingsList(int $total, bool $one): array
{
$rows = $this->ageBetweenSiblingsQuery($total);
$top10 = [];
$dist = [];
Method highlightedImageStartHandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function highlightedImageStartHandler(array $attrs): void
{
$id = '';
if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
$id = $match[1];
Function sortFacts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function sortFacts(Collection $unsorted): Collection
{
$dated = [];
$nondated = [];
$sorted = [];
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$user = Validator::attributes($request)->user();
$place_id = Validator::attributes($request)->integer('place_id', 0);
- 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 myPlot
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function myPlot(
string $chart_title,
array $x_axis,
string $x_axis_title,
array $ydata,
- 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 getFactsWithNotes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getFactsWithNotes(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 getMapData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getMapData(ServerRequestInterface $request): array
{
$facts = $this->getPedigreeMapFacts($request, $this->chart_service);
$geojson = [
- 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 10 (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);
$info_style = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_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 handle
has a Cognitive Complexity of 10 (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 postAddIndividualAction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function postAddIndividualAction(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::parsedBody($request)->isXref()->string('xref');
$option = Validator::parsedBody($request)->string('option');
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function getBlock(Tree $tree, int $block_id, string $context, array $config = []): string
{
$days = (int) $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS);
$infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_INFO_STYLE);
$sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT_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 closeFamily
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function closeFamily(Individual $individual): array
{
$xrefs = [];
foreach ($individual->spouseFamilies() 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 matchRelationships
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function matchRelationships(array $nodes, array $pattern, array $relationships): array
{
$count = count($pattern);
// Look for the longest matchable series of components
- 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 descendants
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function descendants(Individual $individual, int $generations): Collection
{
$descendants = new Collection([$individual->xref() => $individual]);
if ($generations > 0) {
- 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 checkDefaultTreeBlocksExist
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkDefaultTreeBlocksExist(): void
{
$has_blocks = DB::table('block')
->where('gedcom_id', '=', -1)
->exists();
- 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"