Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function broadcastTo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function broadcastTo (options: {
  uris: string[]
  data: any
  byActor: MActorId
  contextType: ContextType
Severity: Minor
Found in server/core/lib/activitypub/send/shared/send-utils.ts - About 1 hr to fix

    Function initialize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private initialize () {
        this.liveEnded = false
    
        this.buildBaseConfig()
    
    
    Severity: Minor
    Found in client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts - About 1 hr to fix

      Function buildHotkeysHelp has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private buildHotkeysHelp (video: Video) {
          if (this.hotkeys.length !== 0) {
            this.hotkeysService.remove(this.hotkeys)
          }
      
      
      Severity: Minor
      Found in client/src/app/+videos/+video-watch/video-watch.component.ts - About 1 hr to fix

        Function updateVideosOverview has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private updateVideosOverview (serverVideosOverview: VideosOverviewServer): Observable<VideosOverview> {
            const observables: Observable<any>[] = []
            const videosOverviewResult: VideosOverview = {
              tags: [],
              categories: [],
        Severity: Minor
        Found in client/src/app/+videos/video-list/overview/overview.service.ts - About 1 hr to fix

          Function waitUntilSegmentGeneration has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async waitUntilSegmentGeneration (options: OverrideCommandOptions & {
              server: PeerTubeServer
              videoUUID: string
              playlistNumber: number
              segment: number
          Severity: Minor
          Found in packages/server-commands/src/videos/live-command.ts - About 1 hr to fix

            Function downloadFile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function downloadFile (options: {
              url: string
              destination: string
              runnerToken: string
              jobToken: string
            Severity: Minor
            Found in apps/peertube-runner/src/shared/http.ts - About 1 hr to fix

              Function up has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function up (utils: {
                transaction: Sequelize.Transaction
                queryInterface: Sequelize.QueryInterface
                sequelize: Sequelize.Sequelize
                db: any
              Severity: Minor
              Found in server/core/initializers/migrations/0660-object-storage.ts - About 1 hr to fix

                Function acceptRunnerJob has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function acceptRunnerJob (req: express.Request, res: express.Response) {
                  const runner = res.locals.runner
                  const runnerJob = res.locals.runnerJob
                
                  const newRunnerJob = await retryTransactionWrapper(() => {
                Severity: Minor
                Found in server/core/controllers/api/runners/jobs.ts - About 1 hr to fix

                  Function handleToken has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  async function handleToken (req: express.Request, res: express.Response, next: express.NextFunction) {
                    const grantType = req.body.grant_type
                  
                    try {
                      const bypassLogin = await buildByPassLogin(req, grantType)
                  Severity: Minor
                  Found in server/core/controllers/api/users/token.ts - About 1 hr to fix

                    Function reorderVideosPlaylist has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    async function reorderVideosPlaylist (req: express.Request, res: express.Response) {
                      const videoPlaylist = res.locals.videoPlaylistFull
                      const body: VideoPlaylistReorder = req.body
                    
                      const start: number = body.startPosition
                    Severity: Minor
                    Found in server/core/controllers/api/video-playlist.ts - About 1 hr to fix

                      Function updateObjectIfNeeded has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      async function updateObjectIfNeeded <T> (options: {
                        url: string
                        bodyValidator: (body: any) => boolean
                        updater: (url: string, newUrl: string) => Promise<T>
                        deleter: (url: string) => Promise<T> }
                      Severity: Minor
                      Found in server/core/lib/job-queue/handlers/activitypub-cleaner.ts - About 1 hr to fix

                        Function processVideosViewsStats has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        async function processVideosViewsStats () {
                          const lastHour = new Date()
                        
                          // In test mode, we run this function multiple times per hour, so we don't want the values of the previous hour
                          if (!isTestOrDevInstance()) lastHour.setHours(lastHour.getHours() - 1)
                        Severity: Minor
                        Found in server/core/lib/job-queue/handlers/video-views-stats.ts - About 1 hr to fix

                          Function buildNewFile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export async function buildNewFile (options: {
                            path: string
                            mode: 'web-video' | 'hls'
                            ffprobe?: FfprobeData
                          }): Promise<MVideoFile> {
                          Severity: Minor
                          Found in server/core/lib/video-file.ts - About 1 hr to fix

                            Function createElements has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              private async createElements (playlist: MVideoPlaylistThumbnail, playlistImportData: SanitizedObject) {
                                const elementsToCreate: { videoId: number, startTimestamp: number, stopTimestamp: number }[] = []
                            
                                for (const element of playlistImportData.elements.slice(0, USER_IMPORT.MAX_PLAYLIST_ELEMENTS)) {
                                  const video = await loadOrCreateVideoIfAllowedForUser(element.videoUrl)

                              Function updateSha256VODSegments has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function updateSha256VODSegments (video: MVideo, playlistArg: MStreamingPlaylist): Promise<MStreamingPlaylistFilesVideo> {
                                return playlistFilesQueue.add(async () => {
                                  const json: { [filename: string]: { [range: string]: string } } = {}
                              
                                  const playlist = await VideoStreamingPlaylistModel.loadWithVideoAndFiles(playlistArg.id)
                              Severity: Minor
                              Found in server/core/lib/hls.ts - About 1 hr to fix

                                Function validate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  async validate (segment: Segment, _method: string, _peerId: string, retry = 1) {
                                    if (this.destroyed) return
                                
                                    this.loadSha256SegmentsPromiseIfNeeded()
                                
                                

                                  Function create has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    async create () {
                                      logger.debug('Adding remote video %s.', this.videoObject.id, this.lTags())
                                  
                                      const channelActor = await this.getOrCreateVideoChannelFromVideoObject()
                                      const channel = channelActor.VideoChannel
                                  Severity: Minor
                                  Found in server/core/lib/activitypub/videos/shared/creator.ts - About 1 hr to fix

                                    Function _notifyVideoQualities has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      private _notifyVideoQualities () {
                                        if (!this.metadata) return
                                    
                                        const resolutions: PeerTubeResolution[] = []
                                    
                                    
                                    Severity: Minor
                                    Found in client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts - About 1 hr to fix

                                      Function signup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        async signup () {
                                          this.signupError = undefined
                                      
                                          const termsForm = this.formStepTerms.value
                                          const userForm = this.formStepUser.value
                                      Severity: Minor
                                      Found in client/src/app/+signup/+register/register.component.ts - About 1 hr to fix

                                        Function buildTitle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          private buildTitle (scope: VideoFilterScope = this.defaultScope, sort: VideoSortField = this.defaultSort) {
                                            const sanitizedSort = this.getSanitizedSort(sort)
                                        
                                            if (scope === 'local') {
                                              this.title = $localize`Local videos`
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language