Function fetchObjectivesAndProgressions
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchObjectivesAndProgressions($url, $root, $dictionary, $objectiveIds)
{
if (preg_match('/\/$/', $url)) {
$url = rtrim($url, '/');
}
- 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 PerCurriculum.php
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @file
* Contains \Educa\DSB\Client\Curriculum\PerCurriculum.
Method fetchObjectivesAndProgressions
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetchObjectivesAndProgressions($url, $root, $dictionary, $objectiveIds)
{
if (preg_match('/\/$/', $url)) {
$url = rtrim($url, '/');
}
Function fetchDomainsAndDisciplines
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function fetchDomainsAndDisciplines($url, $root, $dictionary)
{
if (preg_match('/\/$/', $url)) {
$url = rtrim($url, '/');
}
- 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 fetchDomainsAndDisciplines
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function fetchDomainsAndDisciplines($url, $root, $dictionary)
{
if (preg_match('/\/$/', $url)) {
$url = rtrim($url, '/');
}
Method describeDataStructure
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function describeDataStructure()
{
return array(
(object) array(
'type' => 'cycles',
Method describeTermTypes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function describeTermTypes()
{
return array(
(object) array(
'type' => 'cycles',
Function termFactory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function termFactory($type, $taxonId, $name = null)
{
$code = $url = $schoolYears = null;
if (isset($this->curriculumDictionary["{$type}:{$taxonId}"])) {
$definition = $this->curriculumDictionary["{$type}:{$taxonId}"];
- 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"