Showing 3,313 of 3,313 total issues
Function addVideo
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function addVideo (options: {
req: express.Request
res: express.Response
videoPhysicalFile: express.VideoLegacyUploadFile
videoInfo: VideoCreate
Function addVideosToFeed
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addVideosToFeed (feed: Feed, videos: VideoModel[]) {
/**
* Adding video items to the feed object, one at a time
*/
for (const video of videos) {
Function run
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function run () {
await initDatabaseModels(true)
JobQueue.Instance.init()
Function listForApi
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
static listForApi (parameters: {
start: number
count: number
sort: string
search?: string
Function buildVideosFromRows
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildVideosFromRows (options: {
rows: SQLRow[]
include?: VideoIncludeType
rowsWebVideoFiles?: SQLRow[]
rowsStreamingPlaylist?: SQLRow[]
Function getBypassFromPasswordGrant
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function getBypassFromPasswordGrant (username: string, password: string): Promise<BypassLogin> {
const plugins = PluginManager.Instance.getIdAndPassAuths()
const pluginAuths: { npmName?: string, registerAuthOptions: RegisterServerAuthPassOptions }[] = []
for (const plugin of plugins) {
Function generateSubtitle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function generateSubtitle (options: {
video: MVideoUUID
}) {
const outputPath = join(CONFIG.STORAGE.TMP_DIR, 'transcription', buildSUUID())
Function buildImporters
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private buildImporters (user: MUserDefault) {
// Keep consistency in import order (don't import videos before channels for example)
return [
{
name: 'account' as 'account',
Function getStats
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getStats () {
const { totalLocalVideos, totalLocalVideoViews, totalVideos } = await VideoModel.getStats()
const { totalLocalVideoComments, totalVideoComments } = await VideoCommentModel.getStats()
const {
totalUsers,
Function getContextMenuOptions
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getContextMenuOptions () {
const content = () => {
const self = this
const player = this.player
Function updateForm
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateForm () {
const defaultValues: any = {
nsfw: 'false',
commentsPolicy: this.serverConfig.defaults.publish.commentsPolicy,
downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled,
Similar blocks of code found in 9 locations. Consider refactoring. Open
export const VIDEO_DESCRIPTION_VALIDATOR: BuildFormValidator = {
VALIDATORS: [ Validators.minLength(3), Validators.maxLength(10000) ],
MESSAGES: {
minlength: $localize`Video description must be at least 3 characters long.`,
maxlength: $localize`Video description cannot be more than 10000 characters long.`
- 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 75.
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
Similar blocks of code found in 9 locations. Consider refactoring. Open
export const USER_PASSWORD_OPTIONAL_VALIDATOR: BuildFormValidator = {
VALIDATORS: [
Validators.minLength(6),
Validators.maxLength(255)
],
- 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 75.
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
Function processAudioMergeTranscoding
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function processAudioMergeTranscoding (options: ProcessOptions<RunnerJobVODAudioMergeTranscodingPayload>) {
const { server, job, runnerToken } = options
const payload = job.payload
let ffmpegProgress: number
Similar blocks of code found in 9 locations. Consider refactoring. Open
export const VIDEO_SUPPORT_VALIDATOR: BuildFormValidator = {
VALIDATORS: [ Validators.minLength(3), Validators.maxLength(1000) ],
MESSAGES: {
minlength: $localize`Video support must be at least 3 characters long.`,
maxlength: $localize`Video support cannot be more than 1000 characters long.`
- 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 75.
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
Similar blocks of code found in 9 locations. Consider refactoring. Open
export const USER_BAN_REASON_VALIDATOR: BuildFormValidator = {
VALIDATORS: [
Validators.minLength(3),
Validators.maxLength(250)
],
- 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 75.
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
Similar blocks of code found in 9 locations. Consider refactoring. Open
export const VIDEO_PLAYLIST_DESCRIPTION_VALIDATOR: BuildFormValidator = {
VALIDATORS: [
Validators.minLength(3),
Validators.maxLength(1000)
],
- 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 75.
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
Similar blocks of code found in 9 locations. Consider refactoring. Open
export const VIDEO_CHANNEL_SUPPORT_VALIDATOR: BuildFormValidator = {
VALIDATORS: [
Validators.minLength(3),
Validators.maxLength(1000)
],
- 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 75.
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
Function buildResumeUpload
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected async buildResumeUpload <T> (options: OverrideCommandOptions & {
path: string
fixture: string
attaches?: Record<string, string>
Similar blocks of code found in 9 locations. Consider refactoring. Open
export const USER_DESCRIPTION_VALIDATOR: BuildFormValidator = {
VALIDATORS: [
Validators.minLength(3),
Validators.maxLength(1000)
],
- 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 75.
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