Showing 60 of 170 total issues
Method __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
TypeServiceInterface $typeService,
$year = self::WILDCARD,
$month = self::WILDCARD,
$day = self::WILDCARD,
$hour = self::WILDCARD,
Method findRelations
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findRelations(array $criteria)
{
// Validate the relation type (if given as a criteria)
if (array_key_exists(RelationInterface::FILTER_TYPE, $criteria)) {
RelationFactory::validateRelationType($criteria[RelationInterface::FILTER_TYPE]);
Method __construct
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($locator = null, $datePrecision = null, &$leader = '')
{
if (!empty($locator)) {
// If the local default date precision should be used
if ($datePrecision === null) {
Method testPSR7methods
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testPSR7methods()
{
$url = new Url(self::REMOTE_URL);
$this->assertEquals(self::REMOTE_REPOSITORY_AUTHORITY, $url->getAuthority());
$this->assertEquals('apparat:tools', $url->getUserInfo());
Method matches
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function matches(Url $url)
{
// Test the scheme
$urlScheme = $url->getScheme();
Method loadRevisionData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function loadRevisionData($payload = '', array $propertyData = [])
{
$this->payload = $payload;
// Instantiate the system properties
Method createObjectResource
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createObjectResource(\Closure $creator)
{
$sizeDescriptor = null;
try {
Function __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $data, ObjectInterface $object)
{
parent::__construct($data, $object);
// Initialize the object ID
- 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 matches
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function matches(Url $url)
{
// If the standard URL components don't match
if (!parent::matches($url)) {
return false;
- 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 matches
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function matches(Url $url)
{
// Test the scheme
$urlScheme = $url->getScheme();
- 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 loadObjectResource
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function loadObjectResource(
RepositoryLocatorInterface &$currentLocator,
$visibility = SelectorInterface::ALL
) {
// Validate the object visibility
- 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 normalizeRepositoryUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function normalizeRepositoryUrl($url)
{
// If it's an apparat URL
if ($url instanceof ApparatUrl) {
$url = $url->getNormalizedRepositoryUrl();
- 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 parseRelationUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected static function parseRelationUrl($url, &$coupling, RepositoryInterface $contextRepository)
{
if (strlen($url)) {
// If the URL requires tight coupling
if (!strncmp('!', $url, 1)) {
- 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 filterSingleValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function filterSingleValue($value)
{
// If the value is empty
if (empty($value)) {
return null;
- 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 validateDateComponent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$year = self::WILDCARD,
$month = self::WILDCARD,
$day = self::WILDCARD,
$hour = self::WILDCARD,
$minute = self::WILDCARD,
Function toSerializedArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function toSerializedArray($serialize, array $data)
{
// Filter all empty values
$data = array_filter($data);
- 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
Consider simplifying this complex logical expression. Open
if (!($this->uid instanceof Id)
|| !($this->type instanceof Type)
|| !($this->revision instanceof Revision)
|| !($this->created instanceof \DateTimeInterface)
|| !($this->modified instanceof \DateTimeInterface)
Method createObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
RepositoryInterface $repository,
Type $type,
$payload = '',
array $propertyData = [],
\DateTimeInterface $creationDate = null
Method createObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
RepositoryInterface $repository,
Type $type,
$payload = '',
array $propertyData = [],
\DateTimeInterface $creationDate = null
Function __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($locator = null, $datePrecision = null, &$leader = '')
{
if (!empty($locator)) {
// If the local default date precision should be used
if ($datePrecision === null) {
- 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"