Showing 178 of 178 total issues
Method loadFixtures
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadFixtures()
{
$fixture_dir = $this->config->get('directory');
if (!is_dir($fixture_dir) || !is_readable($fixture_dir)) {
throw new RuntimeError(sprintf('Given fixture path is not a readable directory: %s', $fixture_dir));
Method readAll
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readAll(SettingsInterface $settings = null)
{
$settings = $settings ?: new Settings;
if ($settings->get('first', true)) {
Function mapResultData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function mapResultData(array $result_data)
{
if ($this->config->get('log_result_data', false) === true) {
$this->logger->debug('['.__METHOD__.'] raw result = ' . json_encode($result_data, JSON_PRETTY_PRINT));
}
- 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 updateDesignDoc
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function updateDesignDoc(MigrationTarget $migration_target)
{
$views_directory = $this->getViewsDirectory();
if (!is_dir($views_directory)) {
throw new RuntimeError(sprintf('Given views directory "%s" does not exist.', $views_directory));
- 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 copyFilesToTempLocation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function copyFilesToTempLocation($folder)
{
if (empty($folder) || !is_readable($folder)) {
return;
}
Method guardEventPreConditions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function guardEventPreConditions(AggregateRootEventInterface $event)
{
if (!$event instanceof AggregateRootCreatedEvent
&& $this->getIdentifier() !== $event->getAggregateRootIdentifier()
) {
Method getFreshConnection
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getFreshConnection()
{
$this->needs('user')->needs('password');
// https://github.com/videlalvaro/php-amqplib/blob/master/PhpAmqpLib/Connection/AMQPStreamConnection.php#L8-L39
Method build
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function build()
{
$errors = [];
$add_commands = [];
$modify_commands = [];
Method request
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function request($identifier, $method, array $body = [], array $params = [])
{
$allowed_methods = [ self::METHOD_GET, self::METHOD_POST, self::METHOD_PUT, self::METHOD_DELETE ];
if (!in_array($method, $allowed_methods)) {
throw new RuntimeError(
Method getByIdentifier
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getByIdentifier($identifier)
{
Assertion::string($identifier);
Assertion::notBlank($identifier);
Method getByIdentifiers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getByIdentifiers(array $identifiers)
{
Assertion::notEmpty($identifiers);
$index = $this->getIndex();
Method updateChildNodesAfterMovingParent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateChildNodesAfterMovingParent(EntityInterface $parent)
{
// find all existing children of the moved parent node
$projection_type = $parent->getType();
$parent_identifier = $parent->getIdentifier();
Method translateQueries
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function translateQueries(CriteriaList $criteria_list)
{
if ($criteria_list->isEmpty()) {
return [ 'match_all' => [] ];
} else {
Method applyEvent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function applyEvent(EmbeddedEntityEventInterface $event, $auto_commit = true)
{
$class_parts = explode('\\', get_class($event));
$class_name = array_pop($class_parts);
$callback_func = 'on' . preg_replace('~Event$~', '', $class_name);
Function generate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function generate(ConnectorMap $connector_map)
{
$details = [];
$failing = 0;
$working = 0;
- 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 connect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function connect()
{
$base_uri = $this->config->get('base_uri');
if ($this->config->has('transport') && $this->config->has('host') && $this->config->has('port')) {
$base_uri = sprintf(
- 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 applyEmbeddedEntityEvent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function applyEmbeddedEntityEvent(
EmbeddedEntityEventInterface $embedded_entity_event,
$auto_commit = true
) {
$attribute_name = $embedded_entity_event->getParentAttributeName();
- 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 build
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function build()
{
$errors = [];
$add_commands = [];
$modify_commands = [];
- 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 connect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function connect()
{
$base_uri = $this->config->get('base_uri');
if ($this->config->has('transport') && $this->config->has('host') && $this->config->has('port')) {
$base_uri = sprintf(
- 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 filterUnmodifiedValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function filterUnmodifiedValues(EntityInterface $entity, array $payload)
{
$modified_values = [];
foreach ($entity->getType()->getAttributes() as $attribute_name => $attribute) {
if (!array_key_exists($attribute_name, $payload)) {
- 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"