groundctrl/concerto-bundle

View on GitHub

Showing 12 of 12 total issues

Function testItsPreFlushMethodWorks has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function testItsPreFlushMethodWorks()
    {
        $soloistMock = $this->mock('Ctrl\Bundle\ConcertoBundle\Model\Soloist')
            ->getId(1)
            ->new();
Severity: Minor
Found in src/Tests/EventSubscriber/ClaimEntitySubscriberTest.php - About 2 hrs 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 addSolosSection has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function addSolosSection(ArrayNodeDefinition $rootNode)
    {
        $useIfThere_setNullOtherwise = function(&$ary, $k) {
            if (array_key_exists($k, $ary)) {
                return $ary[$k];
Severity: Major
Found in src/DependencyInjection/Configuration.php - About 2 hrs to fix

Method testItsPreFlushMethodWorks has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function testItsPreFlushMethodWorks()
    {
        $soloistMock = $this->mock('Ctrl\Bundle\ConcertoBundle\Model\Soloist')
            ->getId(1)
            ->new();
Severity: Minor
Found in src/Tests/EventSubscriber/ClaimEntitySubscriberTest.php - About 2 hrs to fix

Method load has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function load(ObjectManager $manager)
    {
        $soloist = new ConcertoTestSoloist();
        $soloist->setDomain('alice.com');
        $manager->persist($soloist);
Severity: Minor
Found in src/DataFixtures/ORM/LoadSoloistAwareEntityData.php - About 1 hr to fix

Method testOnEarlyKernelRequestWorksWhenSoloHasSoloist has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function testOnEarlyKernelRequestWorksWhenSoloHasSoloist()
    {
        $rspEvtMock = $this->rspEvtMock
            ->getRequest($this->requestStub, $this->once())
            ->new()
Severity: Minor
Found in src/Tests/EventListener/FindSoloistListenerTest.php - About 1 hr to fix

Method load has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration($this->getAlias());

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
Severity: Minor
Found in src/DependencyInjection/ConcertoExtension.php - About 1 hr to fix

Function create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function create($conn,  Configuration $config, EventManager $eventManager = null)
    {

        if ( ! $config->getMetadataDriverImpl() ) {
            throw ORMException::missingMappingDriverImpl();
Severity: Minor
Found in src/ORM/Conductor.php - About 35 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

Function preFlush has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function preFlush(PreFlushEventArgs $args)
    {
        $em = $args->getEntityManager();

        $soloist = $em->getSoloist();
Severity: Minor
Found in src/EventListener/ClaimEntitySubscriber.php - About 35 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

Avoid too many return statements within this method.
Open

                                return [ 'class'     => $maybePredefinedSolo,
                                         'arguments' => $args,
                                         'service'   => $v['service'] ];
Severity: Major
Found in src/DependencyInjection/Configuration.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                            ->ifTrue(function($v) { return $v['class'] === null && $v['service'] === null; })
Severity: Major
Found in src/DependencyInjection/Configuration.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                                return $v;
Severity: Major
Found in src/DependencyInjection/Configuration.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                                return $v['class'] !== null && $v['service'] !== null;
Severity: Major
Found in src/DependencyInjection/Configuration.php - About 30 mins to fix
Severity
Category
Status
Source
Language