ernestwisniewski/kbin

View on GitHub

Showing 226 of 573 total issues

Avoid too many return statements within this method.
Open

        return $this->render('user/consent.html.twig', [
            'app_name' => $appName,
            'scopes' => $requestedScopeNames,
            'has_existing_scopes' => $hasExistingScopes,
            'existing_scopes' => $existingScopes,
Severity: Major
Found in src/Controller/Security/LoginController.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return 'post_comment_report';
    Severity: Major
    Found in src/Kbin/Report/DTO/ReportResponseDto.php - About 30 mins to fix

      Function updateMagazine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateMagazine(string $actorUrl): Magazine
          {
              $magazine = $this->magazineRepository->findOneBy(['apProfileId' => $actorUrl]);
              $actor = $this->apHttpClient->getActorObject($actorUrl);
      
      
      Severity: Minor
      Found in src/Service/ActivityPubManager.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

      Function loadingValueChanged has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          loadingValueChanged(val) {
              const submitButton = this.containerTarget.querySelector('form button[type="submit"]');
      
              if (true === val) {
                  if (submitButton) {
      Severity: Minor
      Found in assets/controllers/subject_controller.js - 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

      Function __invoke has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          #[OA\Response(
              response: 200,
              description: 'Tag deleted',
              content: new Model(type: MagazineResponseDto::class),
              headers: [
      Severity: Minor
      Found in src/Controller/Api/Magazine/Admin/MagazineRemoveTagsApi.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

      Function setSubject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          #[Ignore]
          public function setSubject(
              Entry|EntryComment|Post|PostComment|null $subject,
              EntryFactory $entryFactory,
              EntryCommentFactory $entryCommentFactory,
      Severity: Minor
      Found in src/Kbin/Magazine/DTO/MagazineLogResponseDto.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