Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function refreshVideoIfNeeded has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

async function refreshVideoIfNeeded (options: {
  video: MVideoThumbnail
  fetchedType: VideoLoadByUrlType
  syncParam: SyncParam
}): Promise<MVideoThumbnail> {
Severity: Minor
Found in server/core/lib/activitypub/videos/refresh.ts - About 1 hr to fix

    Function generateCaption has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private generateCaption (videos: Video[]) {
        this.videoCaptionService.generateCaption({ videos })
          .subscribe({
            next: result => {
              if (result.success) {
    Severity: Minor
    Found in client/src/app/+admin/overview/videos/video-list.component.ts - About 1 hr to fix

      Function requestNewArchive has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        requestNewArchive () {
          if (this.requestingArchive) return
          this.requestingArchive = true
      
          let baseObs = of<any>(true)

        Function ngOnInit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          ngOnInit () {
            this.buildActions()
        
            this.user = this.authService.getUser()
        
        
        Severity: Minor
        Found in client/src/app/+my-library/my-videos/my-videos.component.ts - About 1 hr to fix

          Function formatUser has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            private formatUser (user: UserServerModel, translations: { [ id: string ]: string } = {}) {
              let videoQuota
              if (user.videoQuota === -1) {
                videoQuota = '∞'
              } else {
          Severity: Minor
          Found in client/src/app/shared/shared-users/user-admin.service.ts - About 1 hr to fix

            Function before has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                before: function () {
                  require('./src/commands/upload')
            
                  // Force keep alive: https://www.browserstack.com/docs/automate/selenium/error-codes/keep-alive-not-used#Node_JS
                  const http = require('http')
            Severity: Minor
            Found in client/e2e/wdio.browserstack.conf.ts - About 1 hr to fix

              Function transcribe has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async transcribe ({
                  mediaFilePath,
                  model = new WhisperBuiltinModel('tiny'),
                  language,
                  format,

                Function getStats has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  static async getStats (strategy: VideoRedundancyStrategyWithManual) {
                    const actor = await getServerActor()
                
                    const sql = `WITH "tmp" AS ` +
                      `(` +
                Severity: Minor
                Found in server/core/models/redundancy/video-redundancy.ts - About 1 hr to fix

                  Function toActivityPubObject has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    toActivityPubObject (this: MVideoRedundancyAP): CacheFileObject {
                      if (this.VideoStreamingPlaylist) {
                        return {
                          id: this.url,
                          type: 'CacheFile' as 'CacheFile',
                  Severity: Minor
                  Found in server/core/models/redundancy/video-redundancy.ts - About 1 hr to fix

                    Function acceptRegistration has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    async function acceptRegistration (req: express.Request, res: express.Response) {
                      const registration = res.locals.userRegistration
                      const body: UserRegistrationUpdateState = req.body
                    
                      const userToCreate = buildUser({
                    Severity: Minor
                    Found in server/core/controllers/api/users/registrations.ts - About 1 hr to fix

                      Function areValidationErrors has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function areValidationErrors (
                        req: express.Request,
                        res: express.Response,
                        options: {
                          omitLog?: boolean
                      Severity: Minor
                      Found in server/core/middlewares/validators/shared/utils.ts - About 1 hr to fix

                        Function onExternalUserAuthenticated has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        async function onExternalUserAuthenticated (options: {
                          npmName: string
                          authName: string
                          authResult: RegisterServerExternalAuthenticatedResult
                        }) {
                        Severity: Minor
                        Found in server/core/lib/auth/external-auth.ts - About 1 hr to fix

                          Function autoBlacklistVideoIfNeeded has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          async function autoBlacklistVideoIfNeeded (parameters: {
                            video: MVideoWithBlacklistLight
                            user?: MUser
                            isRemote: boolean
                            isNew: boolean
                          Severity: Minor
                          Found in server/core/lib/video-blacklist.ts - About 1 hr to fix

                            Function updateUserFromExternal has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            async function updateUserFromExternal (
                              user: MUserDefault,
                              userOptions: ExternalUser,
                              userUpdater: RegisterServerAuthenticatedResult['userUpdater']
                            ) {
                            Severity: Minor
                            Found in server/core/lib/auth/oauth-model.ts - About 1 hr to fix

                              Function init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                init () {
                                  const events = this.getContext().nodeEvent
                                  events.on('postPublish', (sessionId: string, streamPath: string) => {
                                    logger.debug('RTMP received stream', { id: sessionId, streamPath, ...lTags(sessionId) })
                              
                              
                              Severity: Minor
                              Found in server/core/lib/live/live-manager.ts - About 1 hr to fix

                                Function cacheFileActivityObjectToDBAttributes has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId) {
                                
                                  if (cacheFileObject.url.mediaType === 'application/x-mpegURL') {
                                    const url = cacheFileObject.url
                                
                                
                                Severity: Minor
                                Found in server/core/lib/activitypub/cache-file.ts - About 1 hr to fix

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

                                    async create (options: CreateOptions) {
                                      const { video, resolution, fps, priority, dependsOnRunnerJob } = options
                                  
                                      const jobUUID = buildUUID()
                                      const { separatedAudioFile } = video.getMaxQualityAudioAndVideoFiles()

                                    Function createTranscodingJobs has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      async createTranscodingJobs (options: {
                                        transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
                                        video: MVideoFullLight
                                        resolutions: number[]
                                        isNewVideo: boolean

                                      Function optimizeOriginalVideofile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export async function optimizeOriginalVideofile (options: {
                                        video: MVideoFullLight
                                        quickTranscode: boolean
                                        job: Job
                                      }) {
                                      Severity: Minor
                                      Found in server/core/lib/transcoding/web-transcoding.ts - About 1 hr to fix

                                        Function displayFatalError has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          displayFatalError () {
                                            // Already displayed an error
                                            if (this.errorModal) return
                                        
                                            debugLogger('Display fatal error')
                                        Severity: Minor
                                        Found in client/src/assets/player/shared/peertube/peertube-plugin.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language