Showing 177 of 223 total issues
Method execute
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
try {
if (is_array($value)) {
if (!empty($value) && !$this->isAssoc($value)) {
Method createComplexValue
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function createComplexValue(AttributeInterface $attribute, array $options = array())
{
$values = array();
$value_holder = $attribute->createValueHolder();
$value_type = $value_holder->getValueType();
Function getMetadataOptions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function getMetadataOptions()
{
$options = $this->getOptions();
$value_type = self::METADATA_VALUE_TYPE_SCALAR;
- 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 execute
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function execute($values, EntityInterface $entity = null)
{
if (!is_array($values)) {
$this->throwError('non_array_value', [], IncidentInterface::CRITICAL);
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 getMetadataOptions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function getMetadataOptions()
{
$options = $this->getOptions();
$value_type = self::METADATA_VALUE_TYPE_SCALAR;
- 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 execute
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
try {
if (is_array($value)) {
if (!empty($value) && !$this->isAssoc($value)) {
Function getUrlFromArray
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function getUrlFromArray(array $url_parts)
{
// generate the resulting URL
$url = $url_parts['scheme'] . $this->getOption(self::OPTION_SCHEME_SEPARATOR, '://');
- 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 __construct
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $data)
{
// check for mandatory property values
foreach ($this->getMandatoryPropertyNames() as $name) {
if (!array_key_exists($name, $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
Method getAttributeValueByPath
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getAttributeValueByPath(EntityInterface $entity, $value_path)
{
if (!mb_strpos($value_path, self::PATH_DELIMITER)) {
return $entity->getValue($value_path);
}
Method fake
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fake(EntityInterface $entity, array $options = array())
{
if (!empty($options[self::OPTION_LOCALE])) {
$loc = $options[self::OPTION_LOCALE];
if (!is_string($loc) || !preg_match('#[a-z]{2,6}_[A-Z]{2,6}#', $loc)) {
Method execute
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
try {
if (is_array($value)) {
if (!empty($value) && !$this->isAssoc($value)) {
Method getUsedReferenceDefinitions
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUsedReferenceDefinitions(EntityTypeDefinition $type_definition)
{
$reference_definitions_list = new EntityTypeDefinitionList();
$reference_attributes = $type_definition->getAttributes()->filterByType('entity-reference-list');
foreach ($reference_attributes as $reference_attribute) {
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute($values, EntityInterface $entity = null)
{
if (!is_array($values)) {
$this->throwError('non_array_value', [], IncidentInterface::CRITICAL);
return false;
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
if (!is_string($value)) {
$this->throwError('invalid_type', []);
return false;
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $parent_entity = null)
{
$success = true;
$list = null;
Function execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $parent_entity = null)
{
$success = true;
$list = 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
Function deployFiles
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function deployFiles(ClassContainerList $class_containers, $method = 'move')
{
foreach ($class_containers as $class_container) {
$cache_package_dir = $this->buildPackageDirPath($class_container, $this->cache_directory);
$cache_filepath = $cache_package_dir . DIRECTORY_SEPARATOR . $class_container->getFileName();
- 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 castArray
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function castArray($array)
{
$value_type = $this->getOption(self::OPTION_VALUE_TYPE, self::VALUE_TYPE_SCALAR);
$casted = [];
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
if (!is_string($value)) {
$this->throwError('invalid_type', []);
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
Method getUsedEmbedDefinitions
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUsedEmbedDefinitions(EntityTypeDefinition $type_definition)
{
$embed_types_definitions_list = new EntityTypeDefinitionList();
$embed_type_attributes = $type_definition->getAttributes()->filterByType('embedded-entity-list');