SuperdeskWebPublisher/SWPBridgeBundle

View on GitHub

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();

Severity: Major
Found in DependencyInjection/Configuration.php - About 6 hrs to fix

    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);
    Severity: Minor
    Found in DependencyInjection/SWPBridgeExtension.php - About 1 hr to fix

    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) {
    Severity: Minor
    Found in Serializer/PackageSubscriber.php - About 45 mins to fix

    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
    Severity: Minor
    Found in Serializer/ObjectConstructor.php - About 35 mins to fix

      Method makeCall has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $url,
              array $headers = [],
              array $options = [],
              $method = 'GET',
              $content = null
      Severity: Minor
      Found in Client/GuzzleClient.php - About 35 mins to fix

        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);
        Severity: Minor
        Found in Serializer/PackageSubscriber.php - About 25 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language