Showing 54 of 67 total issues
Function postDescription
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function postDescription($json, $catalogs = array(), $previewImage = false)
{
if (empty($this->tokenKey)) {
throw new ClientAuthenticationException("No token found. Cannot create 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 termFactory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function termFactory($type, $taxonId, $name = null)
{
$code = $version = $url = $cycles = $cantons = null;
if (isset($this->curriculumDictionary[$taxonId])) {
$definition = $this->curriculumDictionary[$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"
Further reading
Method describeTermTypes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function describeTermTypes()
{
return array(
(object) array(
'type' => 'fachbereich',
Method describeDataStructure
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function describeDataStructure()
{
return array(
(object) array(
'type' => 'cycles',
Method getPartner
has 33 lines of code (exceeds 25 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.");
}
Method getPartnerStatistics
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPartnerStatistics(
$partnerId,
$from,
$to,
$aggregationMethod = 'day',
Method describeTermTypes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function describeTermTypes()
{
return array(
(object) array(
'type' => 'cycles',
Function isLegacyLOMCHFormat
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function isLegacyLOMCHFormat()
{
$metaDataSchema = $this->getField('metaMetadata.metadataSchema');
if (!empty($metaDataSchema)) {
// Is the data an array? If not, we are dealing with a legacy
- 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 search
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search(
$query = '',
array $useFacets = [],
array $filters = [],
array $additionalFields = [],
Method putDescription
has 28 lines of code (exceeds 25 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.");
}
Function authenticate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function authenticate()
{
if (!file_exists($this->privateKeyPath)) {
throw new ClientAuthenticationException("Private key could not be loaded. Is the path correct ?");
}
- 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 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($type, $id, $name = null, $code = null, $version = null, $url = null, $cycles = null, $cantons = null)
Function mapTerm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function mapTerm($source, $target, TermInterface $term)
{
if (
($source == 'educa' && $target == 'classification system') ||
($source == 'classification system' && $target == 'educa')
- 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 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"
Further reading
Method getPartnerStatistics
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$partnerId,
$from,
$to,
$aggregationMethod = 'day',
$lomId = null,
Method loadPartnerStatistics
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function loadPartnerStatistics($partnerId, $from, $to, $aggregationMethod = 'day', $lomId = null, $limit = null, $offset = null);
Method search
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$query = '',
array $useFacets = array(),
array $filters = array(),
array $additionalFields = array(),
$offset = 0,
Method search
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$query = '',
array $useFacets = [],
array $filters = [],
array $additionalFields = [],
$offset = 0,
Method getPartnerStatistics
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getPartnerStatistics($partnerId, $from, $to, $aggregationMethod = 'day', $lomId = null, $limit = null, $offset = null);
Method loadPartnerStatistics
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$partnerId,
$from,
$to,
$aggregationMethod = 'day',
$lomId = null,