Showing 54 of 67 total issues
Function putDescription
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function putDescription($id, $json, $catalogs = array())
{
if (empty($this->tokenKey)) {
throw new ClientAuthenticationException("No token found. Cannot update a LOM description without a token.");
}
- 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 getVCName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getVCName($vocabularyEntry, array $languageFallback = null)
{
$vocabularyEntry = (array) $vocabularyEntry;
if (isset($vocabularyEntry['ontologyName'])) {
if (isset($languageFallback)) {
- 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($type, $id, $name = null, $code = null, $url = null, $schoolYears = null)
Function setTreeBasedOnTaxonTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setTreeBasedOnTaxonTree($trees)
{
// Prepare a new root item.
$this->root = $this->termFactory('root', 'root');
- 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 findChildrenByNameRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findChildrenByNameRecursive($name)
{
$result = array();
foreach ($this->getChildren() as $child) {
if ($child->describe()->name == $name) {
- 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 findChildByCodeRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findChildByCodeRecursive($code)
{
foreach ($this->getChildren() as $child) {
if ($child->getCode() == $code) {
return $child;
- 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 getPartnerStatistics
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getPartnerStatistics(
$partnerId,
$from,
$to,
$aggregationMethod = 'day',
- 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 getLSValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getLSValue($langString, array $languageFallback = array('de', 'fr', 'it', 'rm', 'en'))
{
if (is_scalar($langString)) {
return $langString;
} else {
- 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 findChildrenByTypeRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findChildrenByTypeRecursive($type)
{
$result = array();
foreach ($this->getChildren() as $child) {
if ($child->describe()->type == $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
Function findChildByIdentifierRecursive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findChildByIdentifierRecursive($id)
{
foreach ($this->getChildren() as $child) {
if ($child->describe()->id == $id) {
return $child;
- 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
Avoid too many return
statements within this method. Open
return (object) array(
'curriculum' => $root,
'dictionary' => $dictionary,
);
Avoid too many return
statements within this method. Open
return $carry;
Avoid too many return
statements within this method. Open
return $nodes;
Function getPartner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPartner($partner = null)
{
if (empty($this->tokenKey)) {
throw new ClientAuthenticationException("No token found. Cannot load a partner without a token.");
}
- 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"