Showing 6 of 6 total issues
Method getConfigTreeBuilder
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('swp_bridge', 'array');
$rootNode = $treeBuilder->getRootNode();
Function load
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function load(array $configs, ContainerBuilder $container)
{
$defaultOptions = [];
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
- 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 onPostDeserialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function onPostDeserialize(ObjectEvent $event)
{
/** @var PackageInterface $package */
$package = $event->getObject();
if ($package instanceof PackageInterface) {
- 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 construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function construct(DeserializationVisitorInterface $visitor, ClassMetadata $metadata, $data, array $type, DeserializationContext $context): ?object
Method makeCall
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$url,
array $headers = [],
array $options = [],
$method = 'GET',
$content = null
Function processGroups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function processGroups(PackageInterface $package): void
{
foreach ((array) $package->getGroups() as $groups) {
foreach ((array) $groups as $key => $group) {
$group->setCode($key);
- 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"