Showing 191 of 1,049 total issues
Method invokeFeedbackForm
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function invokeFeedbackForm($request)
{
$template = $this->twig->load('feedback.twig');
$this->model->setLocale($request->getLang());
$vocabList = $this->model->getVocabularyList(false);
Function linkUrlFilter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function linkUrlFilter($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null)
{
// $vocab can either be null, a vocabulary id (string) or a Vocabulary object
if ($vocab === null) {
return $uri;
- 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 setParameterizedPlugins
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function setParameterizedPlugins(): void
{
$this->pluginParameters = 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
Function changedConcepts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function changedConcepts($request, $prop, $offset, $limit)
{
$changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit);
$simpleChangeList = 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 transformQueryConceptSchemesResults
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function transformQueryConceptSchemesResults($result)
{
$ret = array();
foreach ($result as $row) {
$conceptscheme = 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 getVocabularies
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getVocabularies()
{
if ($this->allVocabularies === null) { // initialize cache
$vocs = $this->globalConfig->getGraph()->allOfType('skosmos:Vocabulary');
$this->allVocabularies = $this->createDataObjects("Vocabulary", $vocs);
- 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 getCollectionMembers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getCollectionMembers($coll, $narrowers)
{
$membersArray = array();
if ($coll->label()) {
$collLabel = $coll->label()->getValue($this->clang) ? $coll->label($this->clang) : $coll->label();
- 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 mappings
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mappings(Request $request)
{
$this->model->setLocale($request->getLang());
$vocab = $request->getVocab();
if ($this->notModified($vocab)) {
Method label
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function label($request)
{
if (!$request->getUri()) {
return $this->returnError(400, "Bad Request", "uri parameter missing");
}
Method transformChangeListResults
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function transformChangeListResults($result)
{
$ret = array();
foreach ($result as $row) {
$concept = array('uri' => $row->concept->getURI());
Method sortValues
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function sortValues()
{
# TODO: sort by URI as last resort
# Note that getLabel() returns URIs in case of no label and may return a prefixed value which affects sorting
if (!empty($this->values)) {
Method generateChildQuery
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateChildQuery($uri, $lang, $fallback, $props)
{
$uri = is_array($uri) ? $uri[0] : $uri;
$fcl = $this->generateFromClause();
$propertyClause = implode('|', $props);
Method generateTransitivePropertyQuery
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateTransitivePropertyQuery($uri, $props, $lang, $limit, $anylang)
{
$uri = is_array($uri) ? $uri[0] : $uri;
$fcl = $this->generateFromClause();
$propertyClause = implode('|', $props);
Method changedConcepts
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function changedConcepts($request, $prop, $offset, $limit)
{
$changeList = $request->getVocab()->getChangeList($prop, $request->getLang(), $offset, $limit);
$simpleChangeList = array();
Function transformCountConceptsResults
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function transformCountConceptsResults($result, $lang)
{
$ret = array();
foreach ($result as $row) {
if (!isset($row->type)) {
- 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 transformTransitivePropertyResults
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private function transformTransitivePropertyResults($uri, $lang, $objects, $tpropname, $tpropuri, $dpropname, $dpropuri)
Method generateAlphabeticalListQuery
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function generateAlphabeticalListQuery($letter, $lang, $limit, $offset, $classes, $showDeprecated = false, $qualifier = null)
Method queryConceptsAlphabetical
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function queryConceptsAlphabetical($letter, $lang, $limit = null, $offset = null, $classes = null, $showDeprecated = false, $qualifier = null)
Method sendFeedback
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function sendFeedback($request, $message, $messageSubject, $fromName = null, $fromEmail = null, $fromVocab = null, $toMail = null)
Method generateAlphabeticalListQuery
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function generateAlphabeticalListQuery($letter, $lang, $limit = null, $offset = null, $classes = null, $showDeprecated = false, $qualifier = null)