Showing 191 of 1,049 total issues
Method invokeVocabularySearch
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function invokeVocabularySearch($request)
{
$template = $this->twig->load('vocab-search.twig');
$this->model->setLocale($request->getLang());
$vocab = $request->getVocab();
Method transformParentListResults
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function transformParentListResults($result, $lang)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->broad)) {
Method hierarchy
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hierarchy($request)
{
if ($this->notModified($request->getVocab())) {
return null;
}
Function transformConceptGroupContentsResults
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function transformConceptGroupContentsResults($result, $lang)
{
$ret = array();
$values = array();
foreach ($result as $row) {
- 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 getDataURLs
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getDataURLs()
{
$ret = array();
$urls = $this->resource->allResources("void:dataDump");
foreach ($urls as $url) {
- 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 findLookupHits
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function findLookupHits($results, $label, $lang)
{
$hits = array();
// case 1: exact match on preferred label
foreach ($results as $res) {
Method invokeGlobalSearch
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function invokeGlobalSearch($request)
{
$lang = $request->getLang();
$template = $this->twig->load('global-search.twig');
$this->model->setLocale($request->getLang());
Function generateConceptSearchQuery
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function generateConceptSearchQuery($fields, $unique, $params, $showDeprecated = false)
{
$vocabs = $params->getVocabs();
$gcl = $this->graphClause;
$fcl = empty($vocabs) ? '' : $this->generateFromClause($vocabs);
- 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 transformChangeListResults
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function transformChangeListResults($result)
{
$ret = array();
foreach ($result as $row) {
$concept = array('uri' => $row->concept->getURI());
- 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 filterPlugins
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function filterPlugins($type, $raw = false)
{
$plugins = $this->getPlugins();
$plugins = $this->sortPlugins($plugins);
$ret = array();
- 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 loadConceptHierarchy
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadConceptHierarchy () {
this.loadingHierarchy = true
fetch('rest/v1/' + window.SKOSMOS.vocab + '/hierarchy/?uri=' + window.SKOSMOS.uri + '&lang=' + window.SKOSMOS.content_lang)
.then(data => {
return data.json()
Function removeDuplicatePropertyValues
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function removeDuplicatePropertyValues($ret, $duplicates)
{
$propertyValues = array();
foreach ($ret as $prop) {
- 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 generateAlphabeticalListQuery
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateAlphabeticalListQuery($letter, $lang, $limit = null, $offset = null, $classes = null, $showDeprecated = false, $qualifier = null)
{
if ($letter == '*' || $letter == '0-9' || $letter == '!*') {
// text index cannot support special character queries, use the generic implementation for these
return parent::generateAlphabeticalListQuery($letter, $lang, $limit, $offset, $classes, $showDeprecated, $qualifier);
Method generateParentListQuery
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateParentListQuery($uri, $lang, $fallback, $props)
{
$fcl = $this->generateFromClause();
$propertyClause = implode('|', $props);
$query = <<<EOQ
Method generateAlphabeticalListQuery
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateAlphabeticalListQuery($letter, $lang, $limit, $offset, $classes, $showDeprecated = false, $qualifier = null)
{
$gcl = $this->graphClause;
$classes = ($classes) ? $classes : array('http://www.w3.org/2004/02/skos/core#Concept');
$values = $this->formatValues('?type', $classes, 'uri');
Method searchConcepts
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchConcepts($params)
{
// don't even try to search for empty prefix if no other search criteria (group or parent concept) has been set
if (($params->getSearchTerm() === "" || !preg_match('/[^*]/', $params->getSearchTerm())) && !$params->getGroupLimit() && !$params->getParentLimit()) {
return array();
Function transformNarrowerResults
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function transformNarrowerResults($result, $lang)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->child)) {
- 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 searchConceptsAndInfo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function searchConceptsAndInfo($params)
{
$params->setUnique(true);
$allhits = $this->searchConcepts($params);
$count = sizeof($allhits);
- 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 transformSearchResults
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function transformSearchResults($request, $results, $parameters)
{
// before serializing to JSON, get rid of the Vocabulary object that came with each resource
foreach ($results as &$res) {
unset($res['voc']);
- 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 getTypes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getTypes($vocid = null, $lang = null)
{
$sparql = (isset($vocid)) ? $this->getVocabulary($vocid)->getSparql() : $this->getDefaultSparql();
$result = $sparql->queryTypes($lang);
foreach ($result as $uri => $values) {
- 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"