Showing 1,292 of 3,313 total issues
File users-command.ts
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { omit, pick } from '@peertube/peertube-core-utils'
import {
HttpStatusCode,
MyUser,
ResultList,
Function buildYoutubeDLImport
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function buildYoutubeDLImport (options: {
targetUrl: string
channel: MChannelAccountDefault
user: MUser
channelSync?: MChannelSync
Notifier
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Notifier {
private readonly notificationModels = {
newVideoOrLive: [ NewVideoOrLiveForSubscribers ],
publicationAfterTranscoding: [ OwnedPublicationAfterTranscoding ],
VideoListComponent
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'my-video-list',
templateUrl: './video-list.component.html',
styleUrls: [ './video-list.component.scss' ],
standalone: true,
SearchComponent
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
@Component({
selector: 'my-search',
styleUrls: [ './search.component.scss' ],
templateUrl: './search.component.html',
standalone: true,
File video-file.ts
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
FFmpegContainer,
ffprobePromise,
getVideoStreamDimensionsInfo,
getVideoStreamFPS,
Function registerOpentelemetryTracing
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function registerOpentelemetryTracing () {
if (CONFIG.OPEN_TELEMETRY.TRACING.ENABLED !== true) {
tracer = new TrackerMock()
return
Function buildWhere
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
private buildWhere () {
let where: string[] = []
if (this.options.videoId) {
this.replacements.videoId = this.options.videoId
- 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 getRemoteObjectOrDie
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
function getRemoteObjectOrDie (
options: CommonProgramOptions,
settings: Settings,
netrc: Netrc
): { url: string, username: string, password: string } {
- 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
File video-playlist.service.ts
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import debug from 'debug'
import { merge, Observable, of, ReplaySubject, Subject } from 'rxjs'
import { catchError, filter, map, share, switchMap, tap } from 'rxjs/operators'
import { HttpClient, HttpContext, HttpParams } from '@angular/common/http'
import { Injectable } from '@angular/core'
Function buildExporters
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildExporters (exportModel: MUserExport, user: MUserDefault) {
const options = {
user,
activityPubFilenames: {
dislikes: 'dislikes.json',
Function processFile
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function processFile (downloader: () => Promise<string>, videoImport: MVideoImportDefault, options: ProcessFileOptions) {
let tmpVideoPath: string
let videoFile: MVideoFile
try {
Function importObject
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected async importObject (videoImportData: SanitizedObject) {
const videoFilePath = !videoImportData.isLive
? this.getSafeArchivePathOrThrow(videoImportData.archiveFiles.videoFile)
: null
File video-upload.component.ts
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { NgIf } from '@angular/common'
import { HttpErrorResponse } from '@angular/common/http'
import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { ActivatedRoute, Router } from '@angular/router'
Function handleSession
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async handleSession (options: {
sessionId: string
inputLocalUrl: string
inputPublicUrl: string
streamKey: string
File benchmark.ts
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Video, VideoPrivacy } from '@peertube/peertube-models'
import {
createSingleServer,
doubleFollow,
killallServers,
PeerTubePlayer
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class PeerTubePlayer {
private readonly eventRegistrar: EventRegistrar = new EventRegistrar()
private channel: Channel.MessagingChannel
private readyPromise: Promise<void>
Function buildInstanceModerationActions
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private buildInstanceModerationActions () {
if (!this.authService.isLoggedIn()) return []
const authUser = this.authService.getUser()
Function getJoins
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private getJoins () {
return `
LEFT JOIN (
"video" AS "Video"
INNER JOIN "videoChannel" AS "Video->VideoChannel" ON "Video"."channelId" = "Video->VideoChannel"."id"
Function oembedValidator
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (areValidationErrors(req, res)) return
if (req.query.format !== undefined && req.query.format !== 'json') {
return res.fail({