Showing 3,313 of 3,313 total issues
Function create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async create (options: CreateOptions) {
const { video, rtmpUrl, toTranscode, playlist, segmentDuration, segmentListSize, outputDirectory, sessionId } = options
const jobUUID = buildUUID()
const payload: RunnerJobLiveRTMPHLSTranscodingPayload = {
Function extendsLocalExpiration
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async extendsLocalExpiration () {
const expired = await VideoRedundancyModel.listLocalExpired()
for (const redundancyModel of expired) {
try {
Function update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
update (event?: any) {
// Playback rate menu button doesn't get a vjs-selected class
// or sets options_['selected'] on the selected playback rate.
// Thus we get the submenu value based on the labelEl of playbackRateMenuButton
if (this.subMenu.name() === 'PlaybackRateMenuButton') {
Function formValidated
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
formValidated () {
this.error = undefined
const body = this.form.value
const videoChannelCreate: VideoChannelCreate = {
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (
protected route: ActivatedRoute,
protected router: Router,
private server: ServerService,
private notifier: Notifier,
Function buildImportVideoObject
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private buildImportVideoObject (video: VideoUpdate): VideoImportCreate {
const language = video.language || null
const licence = video.licence || null
const category = video.category || null
const description = video.description || null
Function buildCommonVideosParams
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildCommonVideosParams (options: CommonVideoParams & { params: HttpParams }) {
const {
params,
videoPagination,
sort,
Function updateDetails
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateDetails (onlyKeys?: string[]) {
const nsfwPolicy = this.form.value['nsfwPolicy']
const p2pEnabled = this.form.value['p2pEnabled']
const autoPlayVideo = this.form.value['autoPlayVideo']
const autoPlayNextVideo = this.form.value['autoPlayNextVideo']
Function getPlayerConstructorOptions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPlayerConstructorOptions (options: {
serverConfig: HTMLServerConfig
authorizationHeader: () => string
}): PeerTubePlayerContructorOptions {
const { serverConfig, authorizationHeader } = options
Function refreshAccessToken
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
refreshAccessToken () {
if (this.refreshingTokenObservable) return this.refreshingTokenObservable
if (!this.getAccessToken()) return throwError(() => new Error($localize`You need to reconnect`))
logger.info('Refreshing token...')
Function computeTypeahead
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
computeTypeahead () {
const searchIndexConfig = this.serverConfig.search.searchIndex
if (!this.activeSearch) {
if (searchIndexConfig.enabled && (searchIndexConfig.isDefaultSearch || searchIndexConfig.disableLocalSearch)) {
Function setUserInfo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
setUserInfo (profile: UserUpdateMe) {
const localStorageKeys = {
nsfwPolicy: UserLocalStorageKeys.NSFW_POLICY,
p2pEnabled: UserLocalStorageKeys.P2P_ENABLED,
autoPlayVideo: UserLocalStorageKeys.AUTO_PLAY_VIDEO,
Function ngOnInit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit () {
this.serverConfig = this.serverService.getHTMLConfig()
this.subActivatedRoute = this.route.queryParams
.subscribe({
Function makeUploadRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function makeUploadRequest (options: CommonRequestParams & {
method?: 'POST' | 'PUT'
fields: { [ fieldName: string ]: any }
attaches?: { [ attachName: string ]: any | any[] }
Function processJob
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function processJob (options: ProcessOptions) {
const { server, job } = options
logger.info(`[${server.url}] Processing job of type ${job.type}: ${job.uuid}`, { payload: job.payload })
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
Consider simplifying this complex logical expression. Open
if (this.user && this.displayOptions.instanceUser && authUser.hasRight(UserRight.MANAGE_USERS) && authUser.canManage(this.user)) {
instanceActions = instanceActions.concat([
{
label: $localize`Edit user`,
description: $localize`Change quota, role, and more.`,
Similar blocks of code found in 4 locations. Consider refactoring. Open
static deleteByVideoId (videoId: number, t: Transaction) {
const query = {
where: {
videoId
},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
playlist?: {
playlistTracker: PlaylistTracker
playNext: () => any
playPrevious: () => any
onVideoUpdate: (uuid: string) => any
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
{
model: AccountModel.unscoped(),
required: true,
include: [
{
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 55.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76