Conditions | 31 |
Paths | 512 |
Total Lines | 88 |
Code Lines | 44 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
39 | public static function convert(Gedcom $gedcom, $format = self::GEDCOM55) |
||
40 | { |
||
41 | $head = $gedcom->getHead(); |
||
42 | $subn = $gedcom->getSubn(); |
||
43 | $subms = $gedcom->getSubm(); // array() |
||
44 | $sours = $gedcom->getSour(); // array() |
||
45 | $indis = $gedcom->getIndi(); // array() |
||
46 | $fams = $gedcom->getFam(); // array() |
||
47 | $notes = $gedcom->getNote(); // array() |
||
48 | $repos = $gedcom->getRepo(); // array() |
||
49 | $objes = $gedcom->getObje(); // array() |
||
50 | |||
51 | $output = '0 FORMAT '.$format."\n"; |
||
52 | |||
53 | // head |
||
54 | if ($head) { |
||
55 | $output = Head::convert($head, $format); |
||
56 | } |
||
57 | |||
58 | // subn |
||
59 | if ($subn) { |
||
60 | $output .= Subn::convert($subn); |
||
61 | } |
||
62 | |||
63 | // subms |
||
64 | if (!empty($subms) && count($subms) > 0) { |
||
65 | foreach ($subms as $item) { |
||
66 | if ($item) { |
||
67 | $output .= Subm::convert($item); |
||
68 | } |
||
69 | } |
||
70 | } |
||
71 | |||
72 | // sours |
||
73 | if (!empty($sours) && count($sours) > 0) { |
||
74 | foreach ($sours as $item) { |
||
75 | if ($item) { |
||
76 | $output .= Sour::convert($item, 0); |
||
77 | } |
||
78 | } |
||
79 | } |
||
80 | |||
81 | // indis |
||
82 | if (!empty($indis) && count($indis) > 0) { |
||
83 | foreach ($indis as $item) { |
||
84 | if ($item) { |
||
85 | $output .= Indi::convert($item); |
||
86 | } |
||
87 | } |
||
88 | } |
||
89 | |||
90 | // fams |
||
91 | if (!empty($fams) && count($fams) > 0) { |
||
92 | foreach ($fams as $item) { |
||
93 | if ($item) { |
||
94 | $output .= Fam::convert($item); |
||
95 | } |
||
96 | } |
||
97 | } |
||
98 | // notes |
||
99 | if (!empty($notes) && count($notes) > 0) { |
||
100 | foreach ($notes as $item) { |
||
101 | if ($item) { |
||
102 | $output .= Note::convert($item); |
||
103 | } |
||
104 | } |
||
105 | } |
||
106 | |||
107 | // repos |
||
108 | if (!empty($repos) && count($repos) > 0) { |
||
109 | foreach ($repos as $item) { |
||
110 | if ($item) { |
||
111 | $output .= Repo::convert($item); |
||
112 | } |
||
113 | } |
||
114 | } |
||
115 | // Objes |
||
116 | if (!empty($objes) && count($objes) > 0) { |
||
117 | foreach ($objes as $item) { |
||
118 | if ($item) { |
||
119 | $output .= Obje::convert($item); |
||
120 | } |
||
121 | } |
||
122 | } |
||
123 | // EOF |
||
124 | $output .= "0 TRLR\n"; |
||
125 | |||
126 | return $output; |
||
127 | } |
||
129 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths