Showing 1,292 of 3,313 total issues
Function loadLocalByName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static loadLocalByName (name: string): Promise<MAccountDefault> {
const fun = () => {
const query = {
where: {
[Op.or]: [
Function listThreadsForApi
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static async listThreadsForApi (parameters: {
video: MVideo
start: number
count: number
sort: string
Function unzip
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export async function unzip (source: string, destination: string) {
await ensureDir(destination)
logger.info(`Unzip ${source} to ${destination}`, lTags())
Function videoFilesDeleteHLSFileValidator
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if (areValidationErrors(req, res)) return
if (!await doesVideoExist(req.params.id, res)) return
const video = res.locals.videoAll
Function jobOfRunnerGetValidatorFactory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function jobOfRunnerGetValidatorFactory (allowedStates: RunnerJobStateType[]) {
return [
param('jobUUID').custom(isUUIDValid),
body('runnerToken').custom(isRunnerTokenValid),
Function run
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async run () {
this.running = true
if (CONFIG.LIVE.RTMP.ENABLED) {
logger.info('Running RTMP server on port %d', CONFIG.LIVE.RTMP.PORT, lTags())
Function buildObservers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildObservers () {
const activeInfohashes = this.meter.createObservableGauge('peertube_bittorrent_tracker_active_infohashes_total', {
description: 'Total active infohashes in the PeerTube BitTorrent Tracker'
})
const inactiveInfohashes = this.meter.createObservableGauge('peertube_bittorrent_tracker_inactive_infohashes_total', {
Function processActivityPubFollow
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function processActivityPubFollow (job: Job) {
const payload = job.data as ActivitypubFollowPayload
const host = payload.host
const handle = host
Function registerPluginOrTheme
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async registerPluginOrTheme (plugin: PluginModel) {
const npmName = PluginModel.buildNpmName(plugin.name, plugin.type)
logger.info('Registering plugin or theme %s.', npmName)
Function loadDynamicPlugins
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private loadDynamicPlugins () {
if (isMobile()) this.player.peertubeMobile()
this.player.bezels()
Function initializePlugin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private initializePlugin () {
initHlsJsPlayer(this.player, this.hlsjs)
this.p2pEngine.on(Events.SegmentError, (segment: Segment, err) => {
if (navigator.onLine === false || this.liveEnded) return
Function trackPrivacyChange
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private trackPrivacyChange () {
// We will update the schedule input and the wait transcoding checkbox validators
this.form.controls['privacy']
.valueChanges
.pipe(map(res => parseInt(res.toString(), 10)))
Function ngOnInit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit () {
this.buildForm({
displayName: VIDEO_PLAYLIST_DISPLAY_NAME_VALIDATOR,
privacy: VIDEO_PLAYLIST_PRIVACY_VALIDATOR,
description: VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR,
Function ngOnInit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit () {
this.subscribeToVideoRequests()
const hiddenFilters = this.hideScopeFilter
? [ 'scope' ]
Function loadMoreChannels
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadMoreChannels () {
const options = {
account: this.account,
componentPagination: this.channelPagination,
sort: '-updatedAt'
Function onTouchMove
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const onTouchMove = (event: TouchEvent) => {
if (!touchDownClientX || !touchDownClientY) {
return
}
Function add
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add (hotkey: Hotkey | Hotkey[]): Hotkey[] | Hotkey {
if (Array.isArray(hotkey)) {
return hotkey.map(h => this.add(h))
}
Function refreshingTokenPromise
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const refreshingTokenPromise = new Promise<void>((resolve, reject) => {
const clientId: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_ID)
const clientSecret: string = peertubeLocalStorage.getItem(this.LOCAL_STORAGE_OAUTH_CLIENT_KEYS.CLIENT_SECRET)
const headers = new Headers()
Function checkAvailableJobs
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async checkAvailableJobs () {
if (!this.initialized) return
if (this.checkingAvailableJobs) return
this.checkingAvailableJobs = true
Function getRemoteObjectOrDie
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getRemoteObjectOrDie (
options: CommonProgramOptions,
settings: Settings,
netrc: Netrc
): { url: string, username: string, password: string } {