Showing 1,049 of 1,049 total issues
Method generateConceptSearchQueryInner
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph)
Function getLanguages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getLanguages()
{
$languageResources = $this->getResource()->getResource('skosmos:languages');
if (!is_null($languageResources) && !empty($languageResources)) {
$languages = 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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($model, $vocab, $resource, $literal, $prop, $clang = '')
Function getReifiedPropertyValues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getReifiedPropertyValues()
{
$ret = array();
$props = $this->resource->propertyUris();
foreach ($props 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
Function sendFeedback
has a Cognitive Complexity of 8 (exceeds 5 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 !== '') {
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($model, $prop, $label, $tooltip = null, $super = null, $sort_by_notation = false)
Method queryTransitiveProperty
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function queryTransitiveProperty($uri, $props, $lang, $limit, $anylang = false, $fallbacklang = '')
Function initializeConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function initializeConfig(): EasyRdf\Resource
{
// retrieve last modified time for config file (filemtime returns int|bool!)
$configModifiedTime = filemtime($this->filePath);
if (!is_bool($configModifiedTime)) {
- 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 getLanguageOrder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getLanguageOrder($clang)
{
if (array_key_exists($clang, $this->languageOrderCache)) {
return $this->languageOrderCache[$clang];
}
- 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 getVocabularyList
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getVocabularyList($categories = true, $shortname = false)
{
$cats = $this->getVocabularyCategories();
$ret = array();
foreach ($cats as $cat) {
- 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 linkUrlFilter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function linkUrlFilter($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null)
Function search
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function search(Request $request): void
{
$maxhits = $request->getQueryParam('maxhits');
$offset = $request->getQueryParam('offset');
$term = $request->getQueryParamRaw('query');
- 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 dumpJsonLd
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function dumpJsonLd()
{
$context = array(
'skos' => EasyRdf\RdfNamespace::get("skos"),
'isothes' => EasyRdf\RdfNamespace::get("isothes"),
- 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 getVocabName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getVocabName($lang = '')
{
if ($this->clang) {
$lang = $this->clang;
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Model $model, Vocabulary $vocab, Resource $target, Resource $source, string $prop, $clang = '')
The class Model has a coupling between objects value of 24. Consider to reduce the number of dependencies under 13. Open
class Model
{
/** cache for Vocabulary objects */
private $allVocabularies = null;
/** cache for Vocabulary objects */
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The class Concept has a coupling between objects value of 17. Consider to reduce the number of dependencies under 13. 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.
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Method transformPropertyResults
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function transformPropertyResults($uri, $lang, $objects, $propname, $propuri)
Method generateChangeListQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function generateChangeListQuery($prop, $lang, $offset, $limit = 200, $showDeprecated = false)
Method generateTransitivePropertyQuery
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function generateTransitivePropertyQuery($uri, $props, $lang, $limit, $anylang)