Showing 191 of 1,049 total issues
Function getLabel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getLabel()
{
foreach ($this->vocab->getConfig()->getLanguageOrder($this->clang) as $fallback) {
if ($this->resource->label($fallback) !== null) {
return $this->resource->label($fallback);
- 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 disambiguateVocabulary
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function disambiguateVocabulary($vocabs, $uri, $preferredVocabId = null)
{
// if there is only one candidate vocabulary, return it
if (sizeof($vocabs) == 1) {
return $vocabs[0];
Method getDataURLs
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDataURLs()
{
$ret = array();
$urls = $this->resource->allResources("void:dataDump");
foreach ($urls as $url) {
Method returnDataResults
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function returnDataResults($results, $format)
{
if ($format == 'application/ld+json' || $format == 'application/json') {
// further compact JSON-LD document using a context
$context = array(
Method getCrumbs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCrumbs($bTresult, $uri, $path = null)
{
$crumbs = array();
if (!isset($path)) {
$path = array();
Function queryTopConcepts
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function queryTopConcepts($conceptSchemes, $lang, $fallback)
{
if (!is_array($conceptSchemes)) {
$conceptSchemes = array($conceptSchemes);
}
- 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 guessVocabularyFromURI
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function guessVocabularyFromURI($uri, $preferredVocabId = null)
{
if ($this->vocabsByUriSpace === null) { // initialize cache
$this->vocabsByUriSpace = array();
foreach ($this->getVocabularies() as $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 asJskos
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function asJskos($queryExVocabs = true, $lang = null, $hrefLink = null)
{
$propertyLabel = $this->getLabel($lang, $queryExVocabs);
$propertyLang = $lang;
if (!is_string($propertyLabel)) {
- 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 combineCrumbs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function combineCrumbs($origCrumbs)
{
$combined = array();
foreach ($origCrumbs as $pathKey => $path) {
$firstToCombine = true;
- 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 getDate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getDate()
{
$ret = '';
$created = '';
try {
- 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 generateQueryTypesQuery
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateQueryTypesQuery($lang)
{
$fcl = $this->generateFromClause();
$query = <<<EOQ
SELECT DISTINCT ?type ?label ?superclass $fcl
Method types
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function types($request)
{
$vocid = $request->getVocab() ? $request->getVocab()->getId() : null;
if ($vocid === null && !$request->getLang()) {
return $this->returnError(400, "Bad Request", "lang parameter missing");
Method getCollections
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCollections($includeArrays)
{
$groups = array();
$collections = $this->graph->resourcesMatching('skos:member', $this->resource);
if (isset($collections)) {
Method vocabularies
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function vocabularies($request)
{
if (!$request->getLang()) {
return $this->returnError(400, "Bad Request", "lang parameter missing");
}
Method invokeVocabularyConcept
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function invokeVocabularyConcept(Request $request)
{
$lang = $request->getLang();
$this->model->setLocale($request->getLang());
$vocab = $request->getVocab();
Method getDate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDate()
{
$ret = '';
$created = '';
try {
Method transformNarrowerResults
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function transformNarrowerResults($result, $lang)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->child)) {
Method getPluginArray
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPluginArray(): array
{
$this->setParameterizedPlugins();
$pluginArray = array();
$vocabularyPlugins = $this->resource->getResource('skosmos:vocabularyPlugins');
Method transformConceptGroupContentsResults
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function transformConceptGroupContentsResults($result, $lang)
{
$ret = array();
$values = array();
foreach ($result as $row) {
Method generateQueryConceptSchemesQuery
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateQueryConceptSchemesQuery($lang)
{
$fcl = $this->generateFromClause();
$query = <<<EOQ
SELECT ?cs ?label ?preflabel ?title ?domain ?domainLabel $fcl