Syndesi/neo4j-sync-bundle

View on GitHub

Showing 38 of 53 total issues

Method getConfigTreeBuilder has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getConfigTreeBuilder(): TreeBuilder
    {
        $treeBuilder = new TreeBuilder('neo4j_sync');
        $rootNode = $treeBuilder->getRootNode();

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

    Method execute has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output): int
        {
            $io = new SymfonyStyle($input, $output);
            if ($input->hasOption('memory')) {
                if ($input->getOption('memory')) {
    Severity: Major
    Found in src/Command/DatabaseSyncCommand.php - About 3 hrs to fix

      Function __construct has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct(array $normalizers = [], array $encoders = [])
          {
              foreach ($normalizers as $normalizer) {
                  if ($normalizer instanceof SerializerAwareInterface) {
                      $normalizer->setSerializer($this);
      Severity: Minor
      Found in src/Serializer/Neo4jSerializer.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 execute has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output): int
          {
              $existingIndices = $this->getNeo4jIndices();
      
              $event = new GetAllIndicesEvent();
      Severity: Major
      Found in src/Command/IndexListCommand.php - About 2 hrs to fix

        Function getNormalizer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getNormalizer(mixed $data, ?string $format, array $context): ?NormalizerInterface
            {
                $type = \is_object($data) ? \get_class($data) : 'native-'.\gettype($data);
        
                if (!isset($this->normalizerCache[$format][$type])) {
        Severity: Minor
        Found in src/Serializer/Neo4jSerializer.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

        Function getDenormalizer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getDenormalizer(mixed $data, string $class, ?string $format, array $context): ?DenormalizerInterface
            {
                if (!isset($this->denormalizerCache[$format][$class])) {
                    $this->denormalizerCache[$format][$class] = [];
        
        
        Severity: Minor
        Found in src/Serializer/Neo4jSerializer.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

        Function execute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output): int
            {
                $io = new SymfonyStyle($input, $output);
                if ($input->hasOption('memory')) {
                    if ($input->getOption('memory')) {
        Severity: Minor
        Found in src/Command/DatabaseSyncCommand.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 execute has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output): int
            {
                $io = new SymfonyStyle($input, $output);
        
                $event = new GetAllIndicesEvent();
        Severity: Minor
        Found in src/Command/IndexSyncCommand.php - About 1 hr to fix

          Function build has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function build(array $nodes): array
              {
                  if (empty($nodes)) {
                      return [];
                  }
          Severity: Minor
          Found in src/Statement/BatchMergeNodeStatementBuilder.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 normalize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function normalize(mixed $data, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null|
                  DateTimeInterface|
                  DateInterval|
                  Neo4j\Date|
                  Neo4j\Time|
          Severity: Minor
          Found in src/Serializer/Neo4jSerializer.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 build has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function build(array $nodes): array
              {
                  if (empty($nodes)) {
                      return [];
                  }
          Severity: Minor
          Found in src/Statement/BatchCreateNodeStatementBuilder.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

          Method build has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function build(array $nodes): array
              {
                  if (empty($nodes)) {
                      return [];
                  }
          Severity: Minor
          Found in src/Statement/BatchCreateNodeStatementBuilder.php - About 1 hr to fix

            Method build has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function build(array $nodes): array
                {
                    if (empty($nodes)) {
                        return [];
                    }
            Severity: Minor
            Found in src/Statement/BatchMergeNodeStatementBuilder.php - About 1 hr to fix

              Function execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output): int
                  {
                      $existingIndices = $this->getNeo4jIndices();
              
                      $event = new GetAllIndicesEvent();
              Severity: Minor
              Found in src/Command/IndexListCommand.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

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

                  protected function execute(InputInterface $input, OutputInterface $output): int
                  {
                      $io = new SymfonyStyle($input, $output);
              
                      $io->newLine();
              Severity: Minor
              Found in src/Command/DatabasePurgeCommand.php - About 1 hr to fix

                Method __construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function __construct(array $normalizers = [], array $encoders = [])
                    {
                        foreach ($normalizers as $normalizer) {
                            if ($normalizer instanceof SerializerAwareInterface) {
                                $normalizer->setSerializer($this);
                Severity: Minor
                Found in src/Serializer/Neo4jSerializer.php - About 1 hr to fix

                  Method build has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function build(array $nodes): array
                      {
                          if (empty($nodes)) {
                              return [];
                          }
                  Severity: Minor
                  Found in src/Statement/BatchDeleteRelationsFromNodeStatementBuilder.php - About 1 hr to fix

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

                        public function current(): array
                        {
                            /** @var class-string $className */
                            $className = $this->className;
                            $elements = $this->em->getRepository($this->className)
                    Severity: Minor
                    Found in src/Provider/DatabaseSyncNodeRelationProvider.php - About 1 hr to fix

                      Method execute has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function execute(InputInterface $input, OutputInterface $output): int
                          {
                              $io = new SymfonyStyle($input, $output);
                      
                              $helper = $this->getHelper('question');
                      Severity: Minor
                      Found in src/Command/IndexPurgeCommand.php - About 1 hr to fix

                        Method configure has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function configure(): void
                            {
                                $this
                                    ->addOption(
                                        'force',
                        Severity: Minor
                        Found in src/Command/DatabaseSyncCommand.php - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language