Chocobozzz/PeerTube

View on GitHub

Showing 3,313 of 3,313 total issues

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

async function up (utils: {
  transaction: Sequelize.Transaction
  queryInterface: Sequelize.QueryInterface
  sequelize: Sequelize.Sequelize
}): Promise<void> {
Severity: Minor
Found in server/core/initializers/migrations/0865-video-file-streams.ts - About 1 hr to fix

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

    async function createOAuthAdminIfNotExist () {
      const exist = await usersExist()
      // Nothing to do, users already exist
      if (exist === true) return undefined
    
    
    Severity: Minor
    Found in server/core/initializers/installer.ts - About 1 hr to fix

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

      function buildPlayerURLQuery (inputQueryUrl: string) {
        const allowedParameters = new Set([
          'start',
          'stop',
          'loop',
      Severity: Minor
      Found in server/core/controllers/services.ts - About 1 hr to fix

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

        const getPluginValidator = (pluginType: PluginType_Type, withVersion = true) => {
          const validators: (ValidationChain | express.Handler)[] = [
            param('pluginName')
              .custom(isPluginNameValid)
          ]
        Severity: Minor
        Found in server/core/middlewares/validators/plugins.ts - About 1 hr to fix

          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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language