Showing 10 of 12 total issues
File torrents.ts
has 459 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-env browser */
import $ from 'jquery';
import Dropzone, {DropzoneFile} from 'dropzone';
import '../css/torrents.scss';
User
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
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')]
Method buildForm
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add(
'username',
Method buildForm
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add(
'username',
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ContainerInterface $container,
mixed $resource,
array $options = [],
RequestContext $context = null,
ContainerInterface $parameters = null,
Method new
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
array $command,
?string $cwd,
?array $env,
mixed $input,
bool $daemon,
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct(Request $request, PaginableRepositoryInterface $entityRepository, $countPerPage, array $criteria = [], array $sort = [])
Method create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static function create(array $command, string $cwd = null, ?array $env = [], mixed $input = null, ?float $timeout = 60): Process
Function getSize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getSize($files): int
{
$size = 0;
$files = $this->toIterable($files);
- Read upRead up
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
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};
- Read upRead up
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"