Showing 191 of 1,049 total issues
File GenericSparql.php
has 1655 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Generates SPARQL queries and provides access to the SPARQL endpoint.
*/
Function getProperties
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
public function getProperties()
{
$properties = array();
$narrowersByUri = array();
$inCollection = 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
File RestController.php
has 883 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* RestController is responsible for handling all the requests directed to the /rest address.
*/
GenericSparql
has 80 functions (exceeds 20 allowed). Consider refactoring. Open
class GenericSparql
{
/**
* A SPARQL Client eg. an EasyRDF instance.
* @property EasyRdf\Sparql\Client $client
File Concept.php
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Dataobject for a single concept.
*/
File VocabularyConfig.php
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* VocabularyConfig provides access to the vocabulary configuration defined in config.ttl.
*/
VocabularyConfig
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class VocabularyConfig extends BaseConfig
{
private $globalPlugins;
private $pluginRegister;
private $pluginParameters = array();
File Vocabulary.php
has 429 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Vocabulary dataobjects provide access to the vocabularies on the SPARQL endpoint.
*/
Function transformParentListResults
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
private function transformParentListResults($result, $lang)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->broad)) {
- 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 transformConceptSearchResult
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
private function transformConceptSearchResult($row, $vocabs, $fields)
{
$hit = array();
$hit['uri'] = $row->s->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
File Model.php
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Importing the dependencies.
*/
Function hierarchy
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function hierarchy($request)
{
if ($this->notModified($request->getVocab())) {
return null;
}
- 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 getMappingProperties
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function getMappingProperties(array $whitelist = null)
{
$ret = array();
$longUris = $this->resource->propertyUris();
- 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
Vocabulary
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class Vocabulary extends DataObject implements Modifiable
{
/** cached value of URI space */
private $urispace = null;
private $config;
Method getProperties
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getProperties()
{
$properties = array();
$narrowersByUri = array();
$inCollection = array();
File WebController.php
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Importing the dependencies.
*/
Concept
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class Concept extends VocabularyDataObject implements Modifiable
{
/**
* Stores a label string if the concept has been found through
* a altLabel/label in a another language than the ui.
Function findLookupHits
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private function findLookupHits($results, $label, $lang)
{
$hits = array();
// case 1: exact match on preferred label
foreach ($results as $res) {
- 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 disambiguateVocabulary
has a Cognitive Complexity of 32 (exceeds 5 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];
- 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 getInfo
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function getInfo($lang = null)
{
$ret = array();
if (!$lang) {
$lang = $this->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"