Anci   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A read() 0 15 4
1
<?php
2
3
namespace FamilyTree365\LaravelGedcom\Utils\Exporter\Indi;
4
5
use FamilyTree365\LaravelGedcom\Models\PersonAnci;
6
7
class Anci
8
{
9
    /**
10
     * String $anci
11
     * String $group
12
     * Integer $group_id.
13
     */
14
    public static function read($conn, $item, $group = '', $group_id = 0, $subm_ids)
0 ignored issues
show
Unused Code introduced by
The parameter $conn is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public static function read(/** @scrutinizer ignore-unused */ $conn, $item, $group = '', $group_id = 0, $subm_ids)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        $record = [];
17
        foreach ($item as $anci) {
18
            if ($anci) {
19
                // store alia
20
                if (isset($subm_ids[$anci])) {
21
                    $subm_id = $subm_ids[$anci];
22
                    $key = ['group'=>$group, 'gid'=>$group_id, 'anci'=>$subm_id];
0 ignored issues
show
Unused Code introduced by
The assignment to $key is dead and can be removed.
Loading history...
23
                    $data = ['group'=>$group, 'gid'=>$group_id, 'anci'=>$subm_id];
24
                    $record[] = $data;
25
                }
26
            }
27
        }
28
        PersonAnci::insert($record);
29
    }
30
}
31