Chocobozzz/PeerTube

View on GitHub

Showing 1,292 of 3,313 total issues

Function setSort has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private setSort (sort: string) {
    if (sort === '-originallyPublishedAt' || sort === 'originallyPublishedAt') {
      this.attributes.push('COALESCE("video"."originallyPublishedAt", "video"."publishedAt") AS "publishedAtForOrder"')
    }

Severity: Minor
Found in server/core/models/video/sql/video/videos-id-list-query-builder.ts - About 1 hr to fix

    Function usersCheckCurrentPasswordFactory has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const usersCheckCurrentPasswordFactory = (targetUserIdGetter: (req: express.Request) => number | string) => {
      return [
        body('currentPassword').optional().custom(exists),
    
        async (req: express.Request, res: express.Response, next: express.NextFunction) => {
    Severity: Minor
    Found in server/core/middlewares/validators/users/users.ts - About 1 hr to fix

      Function ensureCanAccessPrivateVideoHLSFiles has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async (req: express.Request, res: express.Response, next: express.NextFunction) => {
          if (areValidationErrors(req, res)) return
      
          const videoUUID = basename(dirname(req.originalUrl))
      
      
      Severity: Minor
      Found in server/core/middlewares/validators/static.ts - About 1 hr to fix

        Function buildUser has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function buildUser (options: {
          username: string
          password: string
          email: string
        
        
        Severity: Minor
        Found in server/core/lib/user.ts - About 1 hr to fix

          Function buildCounters has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            buildCounters () {
              this.errorsCounter = this.meter.createCounter('peertube_playback_errors_count', {
                description: 'Errors collected from PeerTube player.'
              })
          
          
          Severity: Minor
          Found in server/core/lib/opentelemetry/metric-helpers/playback-metrics.ts - About 1 hr to fix

            Function copyOrRegenerateThumbnails has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            async function copyOrRegenerateThumbnails (options: {
              liveVideo: MVideoThumbnail
              replayVideo: MVideoWithFileThumbnail
            }) {
              const { liveVideo, replayVideo } = options
            Severity: Minor
            Found in server/core/lib/job-queue/handlers/video-live-ending.ts - About 1 hr to fix

              Function checkUserCanApproveVideoComment has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function checkUserCanApproveVideoComment (user: MUserAccountUrl, videoComment: MCommentOwnerVideoReply, res: express.Response) {
                if (videoComment.isDeleted()) {
                  res.fail({
                    status: HttpStatusCode.CONFLICT_409,
                    message: 'This comment is deleted'
              Severity: Minor
              Found in server/core/middlewares/validators/videos/video-comments.ts - About 1 hr to fix

                Function result has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const result = await VideoPathManager.Instance.makeAvailableVideoFile(inputVideoFile, async audioInputPath => {
                      const videoOutputPath = join(transcodeDirectory, video.id + '-transcoded' + newExtname)
                
                      // If the user updates the video preview during transcoding
                      const previewPath = video.getPreview().getPath()
                Severity: Minor
                Found in server/core/lib/transcoding/web-transcoding.ts - About 1 hr to fix

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

                    async create (options: CreateOptions) {
                      const { video, resolution, fps, priority, dependsOnRunnerJob } = options
                  
                      const jobUUID = buildUUID()
                      const payload: RunnerJobVODAudioMergeTranscodingPayload = {

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

                      async create (options: CreateOptions) {
                        const { video, rtmpUrl, toTranscode, playlist, segmentDuration, segmentListSize, outputDirectory, sessionId } = options
                    
                        const jobUUID = buildUUID()
                        const payload: RunnerJobLiveRTMPHLSTranscodingPayload = {

                      Function extendsLocalExpiration has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        private async extendsLocalExpiration () {
                          const expired = await VideoRedundancyModel.listLocalExpired()
                      
                          for (const redundancyModel of expired) {
                            try {
                      Severity: Minor
                      Found in server/core/lib/schedulers/videos-redundancy-scheduler.ts - About 1 hr to fix

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

                          update (event?: any) {
                            // Playback rate menu button doesn't get a vjs-selected class
                            // or sets options_['selected'] on the selected playback rate.
                            // Thus we get the submenu value based on the labelEl of playbackRateMenuButton
                            if (this.subMenu.name() === 'PlaybackRateMenuButton') {
                        Severity: Minor
                        Found in client/src/assets/player/shared/settings/settings-menu-item.ts - About 1 hr to fix

                          Function formValidated has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            formValidated () {
                              this.error = undefined
                          
                              const body = this.form.value
                              const videoChannelCreate: VideoChannelCreate = {

                            Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              constructor (
                                protected route: ActivatedRoute,
                                protected router: Router,
                                private server: ServerService,
                                private notifier: Notifier,

                              Function buildImportVideoObject has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                private buildImportVideoObject (video: VideoUpdate): VideoImportCreate {
                                  const language = video.language || null
                                  const licence = video.licence || null
                                  const category = video.category || null
                                  const description = video.description || null
                              Severity: Minor
                              Found in client/src/app/shared/shared-main/video/video-import.service.ts - About 1 hr to fix

                                Function buildCommonVideosParams has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  buildCommonVideosParams (options: CommonVideoParams & { params: HttpParams }) {
                                    const {
                                      params,
                                      videoPagination,
                                      sort,
                                Severity: Minor
                                Found in client/src/app/shared/shared-main/video/video.service.ts - About 1 hr to fix

                                  Function updateDetails has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    updateDetails (onlyKeys?: string[]) {
                                      const nsfwPolicy = this.form.value['nsfwPolicy']
                                      const p2pEnabled = this.form.value['p2pEnabled']
                                      const autoPlayVideo = this.form.value['autoPlayVideo']
                                      const autoPlayNextVideo = this.form.value['autoPlayNextVideo']

                                    Function getPlayerConstructorOptions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      getPlayerConstructorOptions (options: {
                                        serverConfig: HTMLServerConfig
                                        authorizationHeader: () => string
                                      }): PeerTubePlayerContructorOptions {
                                        const { serverConfig, authorizationHeader } = options
                                    Severity: Minor
                                    Found in client/src/standalone/videos/shared/player-options-builder.ts - About 1 hr to fix

                                      Function refreshAccessToken has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        refreshAccessToken () {
                                          if (this.refreshingTokenObservable) return this.refreshingTokenObservable
                                          if (!this.getAccessToken()) return throwError(() => new Error($localize`You need to reconnect`))
                                      
                                          logger.info('Refreshing token...')
                                      Severity: Minor
                                      Found in client/src/app/core/auth/auth.service.ts - About 1 hr to fix

                                        Function computeTypeahead has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          computeTypeahead () {
                                            const searchIndexConfig = this.serverConfig.search.searchIndex
                                        
                                            if (!this.activeSearch) {
                                              if (searchIndexConfig.enabled && (searchIndexConfig.isDefaultSearch || searchIndexConfig.disableLocalSearch)) {
                                        Severity: Minor
                                        Found in client/src/app/header/search-typeahead.component.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language