Athorcis/athorrent-frontend

View on GitHub

Showing 10 of 12 total issues

File torrents.ts has 459 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-env browser */

import $ from 'jquery';
import Dropzone, {DropzoneFile} from 'dropzone';
import '../css/torrents.scss';
Severity: Minor
Found in assets/js/torrents.ts - About 7 hrs to fix

    User has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    #[ORM\Table]
    #[ORM\UniqueConstraint(name: 'username', columns: ['username'])]
    #[ORM\UniqueConstraint(name: 'port', columns: ['port'])]
    #[ORM\Entity(repositoryClass: UserRepository::class)]
    #[UniqueEntity(fields: ['username'], message: 'error.usernameAlreadyUsed')]
    Severity: Minor
    Found in src/Database/Entity/User.php - About 3 hrs to fix

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

          public function buildForm(FormBuilderInterface $builder, array $options): void
          {
              $builder
                  ->add(
                      'username',
      Severity: Minor
      Found in src/Form/Type/EditAccountType.php - About 1 hr to fix

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

            public function buildForm(FormBuilderInterface $builder, array $options): void
            {
                $builder
                    ->add(
                        'username',
        Severity: Minor
        Found in src/Form/Type/AddUserType.php - About 1 hr to fix

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

                  ContainerInterface $container,
                  mixed $resource,
                  array $options = [],
                  RequestContext $context = null,
                  ContainerInterface $parameters = null,
          Severity: Major
          Found in src/Routing/Router.php - About 50 mins to fix

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

                    array $command,
                    ?string $cwd,
                    ?array $env,
                    mixed $input,
                    bool $daemon,
            Severity: Minor
            Found in src/Process/Process.php - About 45 mins to fix

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

                  public function __construct(Request $request, PaginableRepositoryInterface $entityRepository, $countPerPage, array $criteria = [], array $sort = [])
              Severity: Minor
              Found in src/View/PaginatedView.php - About 35 mins to fix

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

                    public static function create(array $command, string $cwd = null, ?array $env = [], mixed $input = null, ?float $timeout = 60): Process
                Severity: Minor
                Found in src/Process/Process.php - About 35 mins to fix

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

                      public function getSize($files): int
                      {
                          $size = 0;
                          $files = $this->toIterable($files);
                  
                  
                  Severity: Minor
                  Found in src/Filesystem/FileUtils.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 createRequestFromRoute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected createRequestFromRoute(route: Route, params: Params): Request {
                  
                          if (route.prefixId === this.routeParameters._prefixId) {
                              if (route.name === this.action) {
                                  params = {...this.routeParameters, ...this.queryParams, ...params};
                  Severity: Minor
                  Found in assets/js/core/router.ts - 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

                  Severity
                  Category
                  Status
                  Source
                  Language