Chocobozzz/PeerTube

View on GitHub
packages/server-commands/src/server/server.ts

Summary

Maintainability
D
1 day
Test Coverage

File server.ts has 395 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { randomInt } from '@peertube/peertube-core-utils'
import { Video, VideoChannel, VideoChannelSync, VideoCreateResult, VideoDetails } from '@peertube/peertube-models'
import { parallelTests, root } from '@peertube/peertube-node-utils'
import { ChildProcess, fork } from 'child_process'
import { copy } from 'fs-extra/esm'
Severity: Minor
Found in packages/server-commands/src/server/server.ts - About 5 hrs to fix

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

      async run (configOverrideArg?: any, options: RunServerOptions = {}) {
        // These actions are async so we need to be sure that they have both been done
        const serverRunString = {
          'HTTP server listening': false
        }
    Severity: Major
    Found in packages/server-commands/src/server/server.ts - About 2 hrs to fix

      Function assignCommands has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private assignCommands () {
          this.bulk = new BulkCommand(this)
          this.cli = new CLICommand(this)
          this.customPage = new CustomPagesCommand(this)
          this.feed = new FeedCommand(this)
      Severity: Major
      Found in packages/server-commands/src/server/server.ts - About 2 hrs to fix

        Function buildConfigOverride has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private buildConfigOverride (options: RunServerOptions) {
            const base = options.autoEnableImportProxy !== false && process.env.YOUTUBE_DL_PROXY
              ? { import: { videos: { http: { proxies: [ process.env.YOUTUBE_DL_PROXY ] } } } }
              : {}
        
        
        Severity: Minor
        Found in packages/server-commands/src/server/server.ts - About 1 hr to fix

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

                this.app.stdout.on('data', function onStdout (data) {
                  let dontContinue = false
          
                  const log: string = data.toString()
                  aggregatedLogs += log
          Severity: Minor
          Found in packages/server-commands/src/server/server.ts - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status