Showing 1,292 of 3,313 total issues
Function run
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function run () {
await initDatabaseModels(true)
JobQueue.Instance.init()
Function migrate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function migrate () {
const tables = await sequelizeTypescript.getQueryInterface().showAllTables()
// No tables, we don't need to migrate anything
// The installer will do that
Function up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up (utils: {
transaction: Sequelize.Transaction
queryInterface: Sequelize.QueryInterface
sequelize: Sequelize.Sequelize
db: any
Function listCommentsForApi
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static listCommentsForApi (parameters: {
start: number
count: number
sort: string
Function listVideoThreads
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>
Function listVideoThreadComments
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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>
Function downloadWebVideoFile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function downloadWebVideoFile (req: express.Request, res: express.Response) {
const video = res.locals.videoAll
const videoFile = getVideoFileFromReq(req, video.VideoFiles)
if (!videoFile) {
Function video
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const video = await sequelizeTypescript.transaction(async transaction => {
const video = await VideoModel.loadFull(res.locals.videoAll.id, transaction)
oldWebVideoFiles = video.VideoFiles
oldStreamingPlaylists = video.VideoStreamingPlaylists
Function doesVideoExist
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function checkLiveSettingsReplayConsistency
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function checkLiveSettingsReplayConsistency (options: {
res: express.Response
body: LiveVideoUpdate
}) {
const { res, body } = options
Function makeAvailableFactory
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async makeAvailableFactory <T> (options: {
createMethods: MakeAvailableCreateMethod[]
cbContext: MakeAvailableMultipleCB<T>
}) {
const { cbContext, createMethods } = options
Function createEmail
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
async function processActivityPubCleaner (_job: Job) {
logger.info('Processing ActivityPub cleaner.', lTags())
{
const rateUrls = await AccountVideoRateModel.listRemoteRateUrlsOfLocalVideos()
Function handlePasswordGrant
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function handlePasswordGrant (options: {
request: Request
client: MOAuthClient
bypassLogin?: BypassLogin
}) {
Function registerMetrics
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerMetrics (options: { trackerServer: any }) {
if (CONFIG.OPEN_TELEMETRY.METRICS.ENABLED !== true) return
logger.info('Registering Open Telemetry metrics')
Function setupUploadResumableRoutes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function setupUploadResumableRoutes (options: {
router: express.Router
routePath: string
uploadInitBeforeMiddlewares?: RequestHandler[]
Function exportActorFiles
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected exportActorFiles (actor: MActorDefaultBanner) {
const staticFiles: ExportResult<any>['staticFiles'] = []
const relativePathsFromJSON = {
avatar: null as string,
banner: null as string
Function processDislike
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function isSignupAllowedForCurrentIP
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function isSignupAllowedForCurrentIP (ip: string) {
if (!ip) return false
const addr = ipaddr.parse(ip)
const excludeList = [ 'blacklist' ]
Function computeResolutionsToTranscode
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function computeResolutionsToTranscode (options: {
input: number
type: 'vod' | 'live'
includeInput: boolean
strictLower: boolean