Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

Function isLocalByVideoUUIDExists has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static async isLocalByVideoUUIDExists (uuid: string) {
    const actor = await getServerActor()

    const query = {
      raw: true,
Severity: Minor
Found in server/core/models/redundancy/video-redundancy.ts - About 1 hr to fix

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

      static async getStats () {
        const where = {
          deletedAt: null,
          heldForReview: false
        }
    Severity: Minor
    Found in server/core/models/video/video-comment.ts - About 1 hr to fix

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

      async function run () {
        await initDatabaseModels(true)
      
        JobQueue.Instance.init()
      
      
      Severity: Minor
      Found in server/scripts/create-generate-storyboard-job.ts - About 1 hr to fix

        Function migrate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function migrate () {
          const tables = await sequelizeTypescript.getQueryInterface().showAllTables()
        
          // No tables, we don't need to migrate anything
          // The installer will do that
        Severity: Minor
        Found in server/core/initializers/migrator.ts - About 1 hr to fix

          Function up has 27 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/0630-banner.ts - About 1 hr to fix

            Function listCommentsForApi has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              static listCommentsForApi (parameters: {
                start: number
                count: number
                sort: string
            
            
            Severity: Minor
            Found in server/core/models/video/video-comment.ts - About 1 hr to fix

              Function listVideoThreads has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function listVideoThreads (req: express.Request, res: express.Response) {
                const video = res.locals.onlyVideo
                const user = res.locals.oauth ? res.locals.oauth.token.User : undefined
              
                let resultList: ThreadsResultList<MCommentFormattable>
              Severity: Minor
              Found in server/core/controllers/api/videos/comment.ts - About 1 hr to fix

                Function listVideoThreadComments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                async function listVideoThreadComments (req: express.Request, res: express.Response) {
                  const video = res.locals.onlyVideo
                  const user = res.locals.oauth ? res.locals.oauth.token.User : undefined
                
                  let resultList: ResultList<MCommentFormattable>
                Severity: Minor
                Found in server/core/controllers/api/videos/comment.ts - About 1 hr to fix

                  Function downloadWebVideoFile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  async function downloadWebVideoFile (req: express.Request, res: express.Response) {
                    const video = res.locals.videoAll
                  
                    const videoFile = getVideoFileFromReq(req, video.VideoFiles)
                    if (!videoFile) {
                  Severity: Minor
                  Found in server/core/controllers/download.ts - About 1 hr to fix

                    Function video has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        const video = await sequelizeTypescript.transaction(async transaction => {
                          const video = await VideoModel.loadFull(res.locals.videoAll.id, transaction)
                    
                          oldWebVideoFiles = video.VideoFiles
                          oldStreamingPlaylists = video.VideoStreamingPlaylists
                    Severity: Minor
                    Found in server/core/controllers/api/videos/source.ts - About 1 hr to fix

                      Function doesVideoExist has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export async function doesVideoExist (id: number | string, res: Response, fetchType: VideoLoadType = 'all') {
                        const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined
                      
                        const video = await loadVideo(id, fetchType, userId)
                      
                      
                      Severity: Minor
                      Found in server/core/middlewares/validators/shared/videos.ts - About 1 hr to fix

                        Function checkLiveSettingsReplayConsistency has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function checkLiveSettingsReplayConsistency (options: {
                          res: express.Response
                          body: LiveVideoUpdate
                        }) {
                          const { res, body } = options
                        Severity: Minor
                        Found in server/core/middlewares/validators/videos/video-live.ts - About 1 hr to fix

                          Function makeAvailableFactory has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            private async makeAvailableFactory <T> (options: {
                              createMethods: MakeAvailableCreateMethod[]
                              cbContext: MakeAvailableMultipleCB<T>
                            }) {
                              const { cbContext, createMethods } = options
                          Severity: Minor
                          Found in server/core/lib/video-path-manager.ts - About 1 hr to fix

                            Function createEmail has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              createEmail (to: string) {
                                const comment = this.payload
                            
                                const video = comment.Video
                                const videoUrl = WEBSERVER.URL + comment.Video.getWatchStaticPath()

                              Function processActivityPubCleaner has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              async function processActivityPubCleaner (_job: Job) {
                                logger.info('Processing ActivityPub cleaner.', lTags())
                              
                                {
                                  const rateUrls = await AccountVideoRateModel.listRemoteRateUrlsOfLocalVideos()
                              Severity: Minor
                              Found in server/core/lib/job-queue/handlers/activitypub-cleaner.ts - About 1 hr to fix

                                Function handlePasswordGrant has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                async function handlePasswordGrant (options: {
                                  request: Request
                                  client: MOAuthClient
                                  bypassLogin?: BypassLogin
                                }) {
                                Severity: Minor
                                Found in server/core/lib/auth/oauth.ts - About 1 hr to fix

                                  Function registerMetrics has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    registerMetrics (options: { trackerServer: any }) {
                                      if (CONFIG.OPEN_TELEMETRY.METRICS.ENABLED !== true) return
                                  
                                      logger.info('Registering Open Telemetry metrics')
                                  
                                  
                                  Severity: Minor
                                  Found in server/core/lib/opentelemetry/metrics.ts - About 1 hr to fix

                                    Function setupUploadResumableRoutes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function setupUploadResumableRoutes (options: {
                                      router: express.Router
                                      routePath: string
                                    
                                      uploadInitBeforeMiddlewares?: RequestHandler[]
                                    Severity: Minor
                                    Found in server/core/lib/uploadx.ts - About 1 hr to fix

                                      Function exportActorFiles has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        protected exportActorFiles (actor: MActorDefaultBanner) {
                                          const staticFiles: ExportResult<any>['staticFiles'] = []
                                          const relativePathsFromJSON = {
                                            avatar: null as string,
                                            banner: null as string
                                      Severity: Minor
                                      Found in server/core/lib/user-import-export/exporters/actor-exporter.ts - About 1 hr to fix

                                        Function processDislike has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        async function processDislike (activity: ActivityDislike, byActor: MActorSignature) {
                                          const videoUrl = activity.object
                                          const byAccount = byActor.Account
                                        
                                          if (!byAccount) throw new Error('Cannot create dislike with the non account actor ' + byActor.url)
                                        Severity: Minor
                                        Found in server/core/lib/activitypub/process/process-dislike.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language