Showing 60 of 170 total issues
File FileAdapterStrategy.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* apparat-object
*
SystemProperties
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class SystemProperties extends AbstractProperties
{
/**
* Collection name
*
Method findObjectResourceLocators
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findObjectResourceLocators(SelectorInterface $selector, RepositoryInterface $repository)
{
chdir($this->root);
// Build a glob string from the selector
File ObjectProxyTrait.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* apparat-object
*
File RepositoryTest.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* apparat-object
*
RepositoryTest
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class RepositoryTest extends AbstractDisabledAutoconnectorTest
{
/**
* Temporary glob directory
*
Url
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Url extends Uri implements UriInterface, SerializablePropertyInterface
{
/**
* Use PSR-7 method
*/
Method getUrlInternal
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getUrlInternal(array &$override = [])
{
// Prepare the URL scheme
$scheme = !empty($this->urlParts['scheme']) ? $this->getScheme().'://' : '';
if (isset($override['scheme'])) {
Function getUrlInternal
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function getUrlInternal(array &$override = [])
{
// Prepare the URL scheme
$scheme = !empty($this->urlParts['scheme']) ? $this->getScheme().'://' : '';
if (isset($override['scheme'])) {
- 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 setUpBeforeClass
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
self::$globDirs[] =
self::$globBase = sys_get_temp_dir().DIRECTORY_SEPARATOR.'glob';
Function parseRelationString
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected static function parseRelationString($relation, RepositoryInterface $contextRepository)
{
$parsed = [
self::PARSE_URL => null,
self::PARSE_LABEL => 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 configureDependencyInjection
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function configureDependencyInjection(DependencyInjectionContainerInterface $diContainer)
{
parent::configureDependencyInjection($diContainer);
// Configure the repository service
Method createFromParams
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function createFromParams(array $params)
{
$datePrecision = intval(getenv('OBJECT_DATE_PRECISION'));
// Object visibility
Method parseRelationString
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function parseRelationString($relation, RepositoryInterface $contextRepository)
{
$parsed = [
self::PARSE_URL => null,
self::PARSE_LABEL => null,
Method __construct
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(array $data, ObjectInterface $object)
{
parent::__construct($data, $object);
// Initialize the object ID
Method testObjectUrlComparison
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testObjectUrlComparison()
{
$this->assertFalse(
(
new ObjectUrl(
Function findObjectResourceLocators
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function findObjectResourceLocators(SelectorInterface $selector, RepositoryInterface $repository)
{
chdir($this->root);
// Build a glob string from the selector
- 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 setUpBeforeClass
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
self::$globDirs[] =
self::$globBase = sys_get_temp_dir().DIRECTORY_SEPARATOR.'glob';
- 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 testCreateAndPublishArticleObject
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCreateAndPublishArticleObject()
{
putenv('OBJECT_DEFAULT_PRIVACY=public');
// Create a temporary repository & article
Method getSelector
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSelector()
{
$wlc = SelectorInterface::WILDCARD;
$vsb = SelectorInterface::VISIBLE;
$pub = SelectorInterface::PUBLISHED;