Showing 226 of 573 total issues
Function expandComments
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
async expandComments(event) {
event.preventDefault();
if (this.loadingValue === true) {
return;
Method up
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SEQUENCE oauth2_user_consent_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE oauth2_access_token (identifier CHAR(80) NOT NULL, client VARCHAR(32) NOT NULL, expiry TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, user_identifier VARCHAR(128) DEFAULT NULL, scopes TEXT DEFAULT NULL, revoked BOOLEAN NOT NULL, PRIMARY KEY(identifier))');
Function expandComments
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
async expandComments(event) {
event.preventDefault();
if (this.loadingValue === true) {
return;
- 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 addMainSubject
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async addMainSubject(data) {
try {
const url = router().generate(`ajax_fetch_${getTypeFromNotification(data)}`, {id: data.detail.id});
let response = await fetch(url);
Method jsonSerialize
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonSerialize(): mixed
{
if (null === self::$keysToDelete) {
self::$keysToDelete = [
'image',
Function findByObjectId
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function findByObjectId(string $apId): ?array
{
$parsed = parse_url($apId);
if ($parsed['host'] === $this->settingsManager->get('KBIN_DOMAIN')) {
$exploded = array_filter(explode('/', $parsed['path']));
- 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 preparePageResults
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function preparePageResults(iterable $posts): ?iterable
{
$firstIndexes = [];
$tmp = [];
$duplicates = [];
- 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
Method magazine
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function magazine(
Magazine $magazine,
?string $sortBy,
?string $time,
PostRepository $repository,
Method jsonSerialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonSerialize(): mixed
{
if (null === self::$keysToDelete) {
self::$keysToDelete = [
'image',
Method jsonSerialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonSerialize(): mixed
{
if (null === self::$keysToDelete) {
self::$keysToDelete = [
'image',
Method create
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
string $username,
string $email = null,
ImageDto $avatar = null,
ImageDto $cover = null,
string $about = null,
Function getForm
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getForm(event) {
event.preventDefault();
if ('' !== this.containerTarget.innerHTML.trim()) {
if (false === confirm('Do you really want to leave?')) {
Method getUserReputation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUserReputation(User $user, string $className, int $page = 1): PagerfantaInterface
{
$conn = $this->getEntityManager()
->getConnection();
Function filter
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function filter(QueryBuilder $qb, Criteria $criteria): void
{
if ($criteria->post) {
$qb->andWhere('c.post = :post')
->setParameter('post', $criteria->post);
- 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 consent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function consent(Request $request, EntityManagerInterface $entityManager): Response
{
$clientId = $request->query->get('client_id');
if (!$clientId || !ctype_alnum($clientId) || !$this->getUser()) {
return $this->redirectToRoute('front');
- 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
Method getDailyStats
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getDailyStats(string $table, string $relation = null): array
{
$conn = $this->getEntityManager()
->getConnection();
Method findPaginated
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findPaginated(MagazinePageView $criteria): PagerfantaInterface
{
$qb = $this->createQueryBuilder('m')
->andWhere('m.visibility = :visibility')
->setParameter('visibility', VisibilityInterface::VISIBILITY_VISIBLE);
Method views
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'Views by interval retrieved. These are not guaranteed to be continuous.',
content: new OA\JsonContent(
properties: [
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
string $email,
string $username,
string $password,
string $apProfileId = null,
Method views
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'Views by interval retrieved. These are not guaranteed to be continuous.',
content: new OA\JsonContent(
properties: [