rich-id/terms-module

View on GitHub

Showing 15 of 15 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php

declare(strict_types=1);

namespace RichId\TermsModuleBundle\Infrastructure\ValidatorConstraints;
src/Infrastructure/ValidatorConstraints/CantPublicationDateChangeIfTermsPublished.php on lines 1..50
src/Infrastructure/ValidatorConstraints/CantTitleChangeIfTermsPublished.php on lines 1..50

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 177.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php

declare(strict_types=1);

namespace RichId\TermsModuleBundle\Infrastructure\ValidatorConstraints;
src/Infrastructure/ValidatorConstraints/CantContentChangeIfTermsPublished.php on lines 1..50
src/Infrastructure/ValidatorConstraints/CantPublicationDateChangeIfTermsPublished.php on lines 1..50

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 177.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

<?php

declare(strict_types=1);

namespace RichId\TermsModuleBundle\Infrastructure\ValidatorConstraints;
src/Infrastructure/ValidatorConstraints/CantContentChangeIfTermsPublished.php on lines 1..50
src/Infrastructure/ValidatorConstraints/CantTitleChangeIfTermsPublished.php on lines 1..50

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 177.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method buildForm has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add(
                'search',
Severity: Major
Found in src/Infrastructure/FormType/SignatureListFormType.php - About 2 hrs to fix

    Method buildForm has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function buildForm(FormBuilderInterface $builder, array $options): void
        {
            $termsVersion = $options[self::TERMS_VERSION_ENTITY] ?? new TermsVersion();
    
            $builder
    Severity: Major
    Found in src/Infrastructure/FormType/TermsVersionFormType.php - About 2 hrs to fix

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

          public function __invoke(string $termsSlug): Response
          {
              $request = $this->requestStack->getCurrentRequest() ?? new Request();
              $subject = $this->getSubject($request);
              $termsGuardValidation = DummyTermsGuardValidation::create($termsSlug, $subject->getTermsSubjectType(), $subject->getTermsSubjectIdentifier());
      Severity: Minor
      Found in src/UserInterface/Controller/SignRoute.php - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        <?php
        
        declare(strict_types=1);
        
        namespace RichId\TermsModuleBundle\Domain\Exception;
        src/Domain/Exception/EnabledVersionCannotBeDeletedException.php on lines 1..27

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        <?php
        
        declare(strict_types=1);
        
        namespace RichId\TermsModuleBundle\Domain\Exception;
        src/Domain/Exception/AlreadyEnabledTermsVersionException.php on lines 1..27

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 100.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                ActivateTermsVersion $activateTermsVersion,
                TermsUpdater $termsUpdater,
                TermsVersionUpdater $termsVersionUpdater,
                EntityRecoderInterface $entityRecoder,
                EventDispatcherInterface $eventDispatcher,
        Severity: Minor
        Found in src/Domain/UseCase/EditTerms.php - About 45 mins to fix

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

                  TermsVersionSignatureFactory $termsVersionSignatureFactory,
                  EntityRecoderInterface $entityRecoder,
                  EventDispatcherInterface $eventDispatcher,
                  ResponseBuilderInterface $responseBuilder,
                  GetTermsVersionToSign $getTermsVersionToSign
          Severity: Minor
          Found in src/Domain/UseCase/SignTerms.php - About 35 mins to fix

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

                    TermsVersionSignatureRepository $termsVersionSignatureRepository,
                    TermsVersionSignaturePdfGeneratorManager $termsVersionSignaturePdfGeneratorManager,
                    SecurityInterface $security,
                    RequestStack $requestStack,
                    FormFactoryInterface $formFactory
            Severity: Minor
            Found in src/UserInterface/Controller/SignatureListAdminRoute.php - About 35 mins to fix

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

                      HasSignedTerms $hasSignedTerms,
                      GenerateSigningRoute $generateSigningRoute,
                      GenerateTermsRoute $generateTermsRoute,
                      TermsVersionSignatureRepository $termsVersionSignatureRepository,
                      TermsRepositoryInterface $termsRepository
              Severity: Minor
              Found in src/Infrastructure/TwigExtension/TermsExtension.php - About 35 mins to fix

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

                        EditTerms $editTerms,
                        DefaultTermsVersionFactory $defaultTermsVersionFactory,
                        TermsVersionRepository $termsVersionRepository,
                        EntityManagerInterface $entityManager,
                        RequestStack $requestStack
                Severity: Minor
                Found in src/UserInterface/Controller/EditAdminRoute.php - About 35 mins to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  declare(strict_types=1);
                  
                  namespace RichId\TermsModuleBundle\Domain\UseCase;
                  Severity: Minor
                  Found in src/Domain/UseCase/GenerateSigningRoute.php and 1 other location - About 30 mins to fix
                  src/Domain/UseCase/GenerateTermsRoute.php on lines 1..31

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 90.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  <?php
                  
                  declare(strict_types=1);
                  
                  namespace RichId\TermsModuleBundle\Domain\UseCase;
                  Severity: Minor
                  Found in src/Domain/UseCase/GenerateTermsRoute.php and 1 other location - About 30 mins to fix
                  src/Domain/UseCase/GenerateSigningRoute.php on lines 1..31

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 90.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language