Showing 191 of 1,049 total issues
Function invokeGlobalSearch
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function invokeGlobalSearch($request)
{
$lang = $request->getLang();
$template = $this->twig->load('global-search.twig');
$this->model->setLocale($request->getLang());
- 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 getPluginArray
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getPluginArray(): array
{
$this->setParameterizedPlugins();
$pluginArray = array();
$vocabularyPlugins = $this->resource->getResource('skosmos:vocabularyPlugins');
- 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 labelStatistics
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function labelStatistics($request)
{
if ($this->notModified($request->getVocab())) {
return null;
}
Method transformSearchResults
has 42 lines of code (exceeds 25 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']);
Method queryTopConcepts
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function queryTopConcepts($conceptSchemes, $lang, $fallback)
{
if (!is_array($conceptSchemes)) {
$conceptSchemes = array($conceptSchemes);
}
Method vocabularyInformation
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function vocabularyInformation($request)
{
$vocab = $request->getVocab();
if ($this->notModified($vocab)) {
return null;
Method searchConceptsAndInfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function searchConceptsAndInfo($params)
{
$params->setUnique(true);
$allhits = $this->searchConcepts($params);
$count = sizeof($allhits);
Function renderResults
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderResults () {
// TODO: get the results list form cache if it is implemented
const renderedSearchTerm = this.searchTerm // save the search term in case it changes while rendering
this.renderedResultsList.forEach(result => {
Method dumpJsonLd
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dumpJsonLd()
{
$context = array(
'skos' => EasyRdf\RdfNamespace::get("skos"),
'isothes' => EasyRdf\RdfNamespace::get("isothes"),
Method getMappingProperties
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMappingProperties(array $whitelist = null)
{
$ret = array();
$longUris = $this->resource->propertyUris();
Method generateConceptSearchQueryInner
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph)
{
$valuesProp = $this->formatValues('?prop', $props);
$textcond = $this->generateConceptSearchQueryCondition($term, $searchLang);
Method transformTransitivePropertyResults
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function transformTransitivePropertyResults($result, $lang, $fallbacklang)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->object)) {
Method sendFeedback
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null)
{
$toAddress = ($toMail) ? $toMail : $this->model->getConfig()->getFeedbackAddress();
$messageSubject = "[" . $this->model->getConfig()->getServiceName() . "] " . $messageSubject;
if ($fromVocab !== null && $fromVocab !== '') {
Method generateChangeListQuery
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false)
{
$fcl = $this->generateFromClause();
$offset = ($offset) ? 'OFFSET ' . $offset : '';
Method resolve
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolve(int $timeout): ?EasyRdf\Resource
{
try {
// unregister the legacy "json" format as it causes problems with CONSTRUCT requests
EasyRdf\Format::unregister('json');
Method getLabel
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getLabel($lang = '', $fallbackToUri = 'uri')
{
if ($this->clang) {
$lang = $this->clang;
}
Function transformConceptGroupsResults
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function transformConceptGroupsResults($result)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->group)) {
- 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 transformAlphabeticalListResults
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function transformAlphabeticalListResults($results)
{
$ret = array();
foreach ($results 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 transformPropertyQueryResults
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function transformPropertyQueryResults($result, $lang)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->object)) {
- 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 addExternalTriplesToGraph
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function addExternalTriplesToGraph($res, &$seen, $props = null)
{
if (array_key_exists($res->getUri(), $seen) && $seen[$res->getUri()] === 0) {
return;
}
- 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"