| Conditions | 7 |
| Paths | 9 |
| Total Lines | 55 |
| Code Lines | 30 |
| 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 |
||
| 111 | public function generateAlphabeticalListQuery($letter, $lang, $limit = null, $offset = null, $classes = null, $showDeprecated = false, $qualifier = null) |
||
| 112 | { |
||
| 113 | if ($letter == '*' || $letter == '0-9' || $letter == '!*') { |
||
| 114 | // text index cannot support special character queries, use the generic implementation for these |
||
| 115 | return parent::generateAlphabeticalListQuery($letter, $lang, $limit, $offset, $classes, $showDeprecated, $qualifier); |
||
| 116 | } |
||
| 117 | |||
| 118 | $gc = $this->graphClause; |
||
| 119 | $classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept'); |
||
| 120 | $values = $this->formatValues('?type', $classes, 'uri'); |
||
| 121 | $limitandoffset = $this->formatLimitAndOffset($limit, $offset); |
||
| 122 | |||
| 123 | # make text query clause |
||
| 124 | $lcletter = mb_strtolower($letter, 'UTF-8'); // convert to lower case, UTF-8 safe |
||
| 125 | $langClause = $this->generateLangClause($lang); |
||
| 126 | $textcondPref = $this->createTextQueryCondition($letter . '*', 'skos:prefLabel', $langClause); |
||
| 127 | $textcondAlt = $this->createTextQueryCondition($letter . '*', 'skos:altLabel', $langClause); |
||
| 128 | $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang) . " STR(?s) LCASE(STR(?qualifier))"; |
||
| 129 | |||
| 130 | $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : ""; |
||
| 131 | |||
| 132 | $filterDeprecated=""; |
||
| 133 | if(!$showDeprecated){ |
||
| 134 | $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }"; |
||
| 135 | } |
||
| 136 | |||
| 137 | $query = <<<EOQ |
||
| 138 | SELECT DISTINCT ?s ?label ?alabel ?qualifier |
||
| 139 | WHERE { |
||
| 140 | $gc { |
||
| 141 | { |
||
| 142 | $textcondPref |
||
| 143 | FILTER(STRSTARTS(LCASE(STR(?match)), '$lcletter')) |
||
| 144 | FILTER EXISTS { ?s skos:prefLabel ?match } |
||
| 145 | BIND(?match as ?label) |
||
| 146 | } |
||
| 147 | UNION |
||
| 148 | { |
||
| 149 | $textcondAlt |
||
| 150 | FILTER(STRSTARTS(LCASE(STR(?match)), '$lcletter')) |
||
| 151 | FILTER EXISTS { ?s skos:altLabel ?match } |
||
| 152 | BIND(?match as ?alabel) |
||
| 153 | { |
||
| 154 | ?s skos:prefLabel ?label . |
||
| 155 | FILTER (langMatches(LANG(?label), '$lang')) |
||
| 156 | } |
||
| 157 | } |
||
| 158 | ?s a ?type . |
||
| 159 | $qualifierClause |
||
| 160 | $filterDeprecated |
||
| 161 | } $values |
||
| 162 | } |
||
| 163 | ORDER BY $orderbyclause $limitandoffset |
||
| 164 | EOQ; |
||
| 165 | return $query; |
||
| 166 | } |
||
| 169 |
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