Showing 11 of 38 total issues
Method testAliasedItemProperty
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testAliasedItemProperty()
{
$itemFactory = new ItemFactory(0);
$rawItem = (object)[
'type' => ['test'],
Method getItems
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getItems()
{
$items = ItemFactory::createFromApplicationItems(
[
// Stylesheet link item
Method getProfiledNames
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getProfiledNames()
{
$schemaOrgProfile = 'http://schema.org/';
$feedObject = (object)['name' => 'h-feed', 'profile' => MicroformatsFactory::MF2_PROFILE_URI];
$eventObject = (object)['name' => 'Event', 'profile' => $schemaOrgProfile];
Method creationArgumentProvider
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function creationArgumentProvider()
{
$item = new Item('test');
$testT = $this->typ('test');
$nvP = $this->prp('name1', 'value1');
Method renderItem
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderItem(ItemInterface $item)
{
$types = array_map(
function ($type) {
return '<abbr title="'.htmlspecialchars($type->profile.$type->name).'">'.
Method testItemCreation
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$type,
array $properties,
$itemId,
$itemLanguage,
array $expectedTypes,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$format,
PropertyListFactoryInterface $propertyListFactory,
$type,
array $properties = [],
array $children = [],
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$type,
array $properties = [],
$itemId = null,
$itemLanguage = null,
PropertyListFactoryInterface $propertyListFactory = null
Method setup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
PropertyListFactoryInterface $propertyListFactory,
array $type,
array $properties,
$itemId,
$itemLanguage
Function getPropertyCursor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function getPropertyCursor($name): int
{
// Run through all property names
foreach ($this->names as $cursor => $iri) {
foreach ($this->aliases[strval($iri)] as $alias) {
- 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 renderItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function renderItem(ItemInterface $item)
{
$types = array_map(
function ($type) {
return '<abbr title="'.htmlspecialchars($type->profile.$type->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"