Showing 1,726 of 2,403 total issues
Function checkDefaultUserBlocksExist
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkDefaultUserBlocksExist(): void
{
$has_blocks = DB::table('block')
->where('user_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"
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)->treeOptional();
$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 handle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$default = Site::getPreference('DEFAULT_GEDCOM');
$tree = $this->tree_service->all()->get($default) ?? $this->tree_service->all()->first();
$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 handle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->treeOptional();
$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 handle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::attributes($request)->isXref()->string('xref');
$slug = Validator::attributes($request)->string('slug', '');
- 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 updateRecord
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function updateRecord(string $gedrec, Tree $tree, bool $delete): void
{
if (preg_match('/^0 @(' . Gedcom::REGEX_XREF . ')@ (' . Gedcom::REGEX_TAG . ')/', $gedrec, $match)) {
[, $gid, $type] = $match;
} elseif (preg_match('/^0 (HEAD)(?:\n|$)/', $gedrec, $match)) {
- 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 generate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function generate(Individual $individual, Individual $head): string
{
if ($individual->getBirthDate()->isOK()) {
foreach ($individual->spouseFamilies() as $family) {
foreach ($family->facts(['MARR'], true) as $fact) {
- 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 childStepFamilies
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function childStepFamilies(): Collection
{
$step_families = new Collection();
$families = $this->childFamilies();
foreach ($families 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 spouseStepFamilies
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function spouseStepFamilies(): Collection
{
$step_families = [];
$families = $this->spouseFamilies();
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function render($renderer): void
{
static $lastpicbottom, $lastpicpage, $lastpicleft, $lastpicright;
// Get the current positions
- 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 endElement
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function endElement($parser, string $name): void
{
if (($this->process_footnote || $name === 'Footnote') && ($this->process_ifs === 0 || $name === 'if') && ($this->process_gedcoms === 0 || $name === 'Gedcom') && ($this->process_repeats === 0 || $name === 'Facts' || $name === 'RepeatTag' || $name === 'List' || $name === 'Relatives')) {
$method = $name . 'EndHandler';
- 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 privatizeGedcom
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function privatizeGedcom(int $access_level): string
{
if ($access_level === Auth::PRIV_HIDE) {
return $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 sitemapRecords
has 27 lines of code (exceeds 25 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);
Method handle
has 27 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();
$generations = Validator::attributes($request)->isBetween(self::MINIMUM_GENERATIONS, self::MAXIMUM_GENERATIONS)->integer('generations');
Method getFooter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFooter(ServerRequestInterface $request): string
{
$tree = Validator::attributes($request)->treeOptional();
if ($tree === null) {
Method postEditNewsAction
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postEditNewsAction(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if (!Auth::isManager($tree)) {
Method postEditJournalAction
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postEditJournalAction(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if (!Auth::check()) {
Method share
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function share(GedcomRecord $record): string
{
if ($record instanceof Individual) {
$facts = $record->facts(static::INDIVIDUAL_EVENTS, true)
->merge($record->spouseFamilies()->map(fn (Family $family): Collection => $family->facts(static::FAMILY_EVENTS, true)));
Method getEditNewsAction
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getEditNewsAction(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
if (!Auth::isManager($tree)) {
Method mediaFileInfo
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function mediaFileInfo(FilesystemOperator $data_filesystem, string $file): string
{
$html = '<dl>';
$html .= '<dt>' . I18N::translate('Filename') . '</dt>';
$html .= '<dd>' . e($file) . '</dd>';