Showing 1,726 of 2,403 total issues
Function handle
has a Cognitive Complexity of 8 (exceeds 5 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');
- 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 childFacts
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function childFacts(Individual $person, Family $family, string $option, string $relation, Date $min_date, Date $max_date): Collection
Function importLegacyPlacDefn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function importLegacyPlacDefn(string $gedcom): void
{
$gedcom_service = new GedcomService();
if (preg_match('/\n1 PLAC (.+)/', $gedcom, $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
Method message
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function message(UserInterface $from, UserInterface $to, UserInterface $reply_to, string $subject, string $message_text, string $message_html): Message
Function handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$token = $request->getAttribute('token');
$tree = Validator::attributes($request)->treeOptional();
$username = $request->getAttribute('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 handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handle(ServerRequestInterface $request): ResponseInterface
{
$tree = Validator::attributes($request)->tree();
$xref = Validator::attributes($request)->isXref()->string('xref');
$record = Registry::gedcomRecordFactory()->make($xref, $tree);
- 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 searchIndividualsPhonetic
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function searchIndividualsPhonetic(string $soundex, string $lastname, string $firstname, string $place, array $search_trees): Collection
{
switch ($soundex) {
default:
case 'Russell':
- 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 send
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function send(UserInterface $from, UserInterface $to, UserInterface $reply_to, string $subject, string $message_text, string $message_html): bool
Method getCalendarEvents
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getCalendarEvents(int $jd1, int $jd2, string $facts, Tree $tree, string $filterof = '', string $filtersx = ''): array
Function symmetricCousin
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function symmetricCousin(): Relationship
{
$this->matchers[] = static function (array &$nodes, array &$patterns, array &$captures): bool {
$count = count($patterns);
- 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 subtag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function subtag(string $subtag, string $repeat, string $before = ''): void
{
if ($before === '' || ($this->subtags[$before] ?? null) === null) {
$this->subtags[$subtag] = $repeat;
} else {
- 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 chartSex
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
int $tot_m,
int $tot_f,
int $tot_u,
string|null $color_female = null,
string|null $color_male = null,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
CenturyService $century_service,
ColorService $color_service,
CountryService $country_service,
ModuleService $module_service,
Tree $tree,
Function generate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function generate(Individual $individual, Individual $head): string
{
$marriage_date = null;
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
Avoid deeply nested control flow statements. Open
if (!str_contains(self::NUMBERS, $charArray['letter'])) {
// This is not a digit. End the run of digits and punctuation.
$numberState = false;
if (self::$currentState === 'RTL') {
if (!str_contains(self::NUMBER_PREFIX, $currentLetter)) {
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(int $id, string $name, string $title)
{
$this->id = $id;
$this->name = $name;
$this->title = $title;
- 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
Avoid deeply nested control flow statements. Open
if (str_ends_with($textSpan, ' ')) {
$trailingSeparator = ' ' . $trailingSeparator;
$textSpan = substr($textSpan, 0, -6);
continue;
}
Avoid deeply nested control flow statements. Open
if (str_ends_with($textSpan, ' ')) {
$trailingBlanks = ' ' . $trailingBlanks;
$textSpan = substr($textSpan, 0, -1);
continue;
}
Avoid deeply nested control flow statements. Open
if (self::$currentState === '') {
$newState = 'RTL';
break;
}
Function attributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function attributes(): array
{
$attributes = [];
if (!$this->isExternal() || $this->fileExists()) {
- 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"