Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function userImportRequestResumableInitValidator has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async (req: express.Request, res: express.Response, next: express.NextFunction) => {
    if (areValidationErrors(req, res)) return

    if (CONFIG.IMPORT.USERS.ENABLED !== true) {
      return res.fail({
Severity: Minor
Found in server/core/middlewares/validators/users/user-import.ts - About 1 hr to fix

    Function getUser has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    async function getUser (usernameOrEmail?: string, password?: string, bypassLogin?: BypassLogin) {
      // Special treatment coming from a plugin
      if (bypassLogin && bypassLogin.bypass === true) {
        logger.info('Bypassing oauth login by plugin %s.', bypassLogin.pluginName)
    
    
    Severity: Minor
    Found in server/core/lib/auth/oauth-model.ts - About 1 hr to fix

      Function buildPlaylistHTML has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private static buildPlaylistHTML (options: {
          html: string
          playlist: MVideoPlaylistFull
      
          addOG: boolean
      Severity: Minor
      Found in server/core/lib/html/shared/playlist-html.ts - About 1 hr to fix

        Function updateVideoViewersCount has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private async updateVideoViewersCount () {
            if (this.processingViewerCounters) return
            this.processingViewerCounters = true
        
            if (!isTestOrDevInstance()) {
        Severity: Minor
        Found in server/core/lib/views/shared/video-viewer-counters.ts - About 1 hr to fix

          Function handleHLSJob has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function handleHLSJob (job: Job, payload: HLSTranscodingPayload, videoArg: MVideoFullLight) {
            logger.info('Handling HLS transcoding job for %s.', videoArg.uuid, lTags(videoArg.uuid), { payload })
          
            const inputFileMutexReleaser = await VideoPathManager.Instance.lockFiles(videoArg.uuid)
            let video: MVideoFullLight
          Severity: Minor
          Found in server/core/lib/job-queue/handlers/video-transcoding.ts - About 1 hr to fix

            Function processActivities has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function processActivities (
              activities: Activity[],
              options: {
                signatureActor?: MActorSignature
                inboxActor?: MActorDefault
            Severity: Minor
            Found in server/core/lib/activitypub/process/process.ts - About 1 hr to fix

              Function checkLatestPluginsVersion has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                private async checkLatestPluginsVersion () {
                  if (CONFIG.PLUGINS.INDEX.ENABLED === false) return
              
                  logger.info('Checking latest plugins version.')
              
              
              Severity: Minor
              Found in server/core/lib/schedulers/plugins-check-scheduler.ts - About 1 hr to fix

                Function createEl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  createEl () {
                    const el = super.createEl('div', { className: 'peertube-dock' })
                
                    if (this.options_.avatarUrl) {
                      const avatar = videojs.dom.createEl('img', {
                Severity: Minor
                Found in client/src/assets/player/shared/dock/peertube-dock-component.ts - About 1 hr to fix

                  Function update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async update () {
                      const avatarsInfo = getImagesInfoFromObject(this.actorObject, ActorImageType.AVATAR)
                      const bannersInfo = getImagesInfoFromObject(this.actorObject, ActorImageType.BANNER)
                  
                      try {
                  Severity: Minor
                  Found in server/core/lib/activitypub/actors/updater.ts - About 1 hr to fix

                    Function activityPubCollectionPagination has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export async function activityPubCollectionPagination (
                      baseUrl: string,
                      handler: ActivityPubCollectionPaginationHandler,
                      page?: any,
                      size = ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE
                    Severity: Minor
                    Found in server/core/lib/activitypub/collection.ts - About 1 hr to fix

                      Function buildOverviewItems has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        private buildOverviewItems () {
                          const overviewItems: TopMenuDropdownParam = {
                            label: $localize`Overview`,
                            children: []
                          }
                      Severity: Minor
                      Found in client/src/app/+admin/admin.component.ts - About 1 hr to fix

                        Function buildVODHandlers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          private buildVODHandlers () {
                            const handlers: KeyHandler[] = [
                              // Rewind
                              {
                                accept: e => this.isNaked(e, 'ArrowLeft') || this.isNaked(e, 'MediaRewind'),
                        Severity: Minor
                        Found in client/src/assets/player/shared/hotkeys/peertube-hotkeys-plugin.ts - About 1 hr to fix

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

                            ngOnInit () {
                              this.actions = [
                                [
                                  {
                                    label: $localize`Cancel this job`,

                            Function buildPeerTubePlayerConstructorOptions has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              private buildPeerTubePlayerConstructorOptions (options: {
                                urlOptions: URLOptions
                              }): PeerTubePlayerContructorOptions {
                                const { urlOptions } = options
                            
                            
                            Severity: Minor
                            Found in client/src/app/+videos/+video-watch/video-watch.component.ts - About 1 hr to fix

                              Function importVideo has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                importVideo (torrentfile?: Blob) {
                                  this.isImportingVideo = true
                              
                                  const videoUpdate: VideoUpdate = {
                                    privacy: this.highestPrivacy,

                                Function runTranscoding has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  runTranscoding (options: {
                                    videos: Video[]
                                    type: 'hls' | 'web-video'
                                    forceTranscoding?: boolean
                                  }): Observable<any> {
                                Severity: Minor
                                Found in client/src/app/shared/shared-main/video/video.service.ts - About 1 hr to fix

                                  Function deleteSelectedVideos has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    async deleteSelectedVideos () {
                                      const toDeleteVideosIds = Object.entries(this.selection)
                                                                      .filter(([ _k, v ]) => v === true)
                                                                      .map(([ k, _v ]) => parseInt(k, 10))
                                  
                                  
                                  Severity: Minor
                                  Found in client/src/app/+my-library/my-videos/my-videos.component.ts - About 1 hr to fix

                                    Function askVideoPassword has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      async askVideoPassword (options: { incorrectPassword: boolean, translations: Translations }): Promise<string> {
                                        const { incorrectPassword, translations } = options
                                        return new Promise((resolve) => {
                                    
                                          this.wrapperElement.style.display = 'none'
                                    Severity: Minor
                                    Found in client/src/standalone/videos/shared/player-html.ts - About 1 hr to fix

                                      Function run has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        async run () {
                                          logger.info('Running PeerTube runner in server mode')
                                      
                                          const enabledJobsArray = this.enabledJobs
                                            ? Array.from(this.enabledJobs)
                                      Severity: Minor
                                      Found in apps/peertube-runner/src/server/server.ts - About 1 hr to fix

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

                                        export async function getVideoStreamCodec (path: string, existingProbe?: FfprobeData) {
                                          const videoStream = await getVideoStream(path, existingProbe)
                                          if (!videoStream) return ''
                                        
                                          const videoCodec = videoStream.codec_tag_string
                                        Severity: Minor
                                        Found in server/core/helpers/ffmpeg/codecs.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language