Showing 177 of 223 total issues
Function valueEquals
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function valueEquals($other_value)
{
if (!is_array($other_value)) {
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 parseEntityTypeDefinition
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseEntityTypeDefinition(DOMXPath $xpath, DOMElement $element)
{
$implementor = null;
$implementor_list = $xpath->query('./implementor', $element);
if ($implementor_list->length > 0) {
Method buildPhoneMap
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function buildPhoneMap(Generator $generator)
{
return array_fill_keys(
[
'phone',
Method configure
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this->setName('generate_code')
->setDescription('Generate and/or deploy code for a given type schema_path.')
->addOption(
Function collateChildren
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function collateChildren(Closure $criteria, $recursive = true)
{
$entity_map = new EntityMap;
$nested_attribute_types = [ EmbeddedEntityListAttribute::CLASS, EntityReferenceListAttribute::CLASS ];
foreach ($this->getType()->getAttributes([], $nested_attribute_types) as $attribute) {
- 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 getReferenceAttributes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getReferenceAttributes($recursive = true)
{
$attribute_types = [ EmbeddedEntityListAttribute::CLASS, EntityReferenceListAttribute::CLASS ];
$reference_attributes = new AttributeMap;
- 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 collateAttributes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function collateAttributes(Closure $filter, $recursive = true)
{
$mirrored_attributes = new AttributeMap;
foreach ($this->getAttributes() as $attribute_name => $attribute) {
if ($filter($attribute) === true) {
- 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 validate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, EntityInterface $entity = null)
{
$result = new Result($this);
$result->setInputValue($value);
- 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 createPluginData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function createPluginData(array $settings, $config_dir)
{
$plugin_settings = [];
foreach ($settings as $setting_label => $setting_data) {
if (!preg_match('/^plugin\:/', $setting_label)) {
- 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 setSpecificationMap
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function setSpecificationMap($specification_map)
{
if ($specification_map instanceof SpecificationMap) {
$this->specification_map = $specification_map;
} elseif (is_array($specification_map)) {
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
if (!is_string($value)) {
$this->throwError('non_string_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 preRenderOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function preRenderOptions(OptionDefinitionList $options, $initial_indent = 0, $indent_size = 4)
{
if ($options->getSize() === 0) {
return '[]';
}
- 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 executePlugins
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function executePlugins(EntityTypeSchema $type_schema)
{
foreach ($this->config->getPluginSettings() as $plugin_class => $plugin_options) {
if (class_exists($plugin_class)) {
if (is_a($plugin_class, '\\Trellis\\CodeGen\\PluginInterface', true)) {
- 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 getSuspiciousChecker
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getSuspiciousChecker()
{
$spoofchecker = new Spoofchecker();
// Allowing only certain locales enables rejection of e.g. korean script when a text should be en_US only
- 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 createValueHolder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function createValueHolder($apply_default_values = false)
{
if (!$this->value_holder_implementor) {
$implementor = $this->hasOption(self::OPTION_VALUE_HOLDER)
? $this->getOption(self::OPTION_VALUE_HOLDER)
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
$null_value = $this->getOption(AttributeInterface::OPTION_NULL_VALUE, null);
if ($value === $null_value || $value === '') {
// accept NULL or empty string as valid NULL value when NULL value is NULL :D
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
protected function execute($value, EntityInterface $entity = null)
{
if (is_null($value)) {
$value = '';
}
- 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 getConfusableChecker
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getConfusableChecker()
{
$spoofchecker = new Spoofchecker();
// Allowing only certain locales enables rejection of e.g. korean script when a text should be en_US only
- 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 8 (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 parseOffsetExpression
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected static function parseOffsetExpression($offset_expression)
{
$compare_attribute = null;
$compare_value = 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"