Toollabs/video2commons

View on GitHub

Showing 31 of 99 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if res.result['type'] == 'done':
                    task.update({
                        'status': 'done',
                        'url': res.result['url'],
                        'text': res.result['filename']
Severity: Minor
Found in video2commons/frontend/api.py and 1 other location - About 35 mins to fix
video2commons/frontend/api.py on lines 179..183

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 33.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

        if p == 1:
            # Make first pass faster...
            cmd += ' -speed 4'
        elif 'speed' in options:
            cmd += ' -speed ' + escape_shellarg(options['speed'])
Severity: Major
Found in video2commons/backend/encode/transcodejob.py and 8 other locations - About 35 mins to fix
video2commons/backend/encode/transcodejob.py on lines 214..215
video2commons/backend/encode/transcodejob.py on lines 278..279
video2commons/backend/encode/transcodejob.py on lines 315..316
video2commons/backend/encode/transcodejob.py on lines 326..328
video2commons/backend/encode/transcodejob.py on lines 389..390
video2commons/backend/encode/transcodejob.py on lines 406..407
video2commons/backend/encode/transcodejob.py on lines 412..413
video2commons/backend/encode/transcodejob.py on lines 415..416

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 33.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

        if 'vpre' in options:
            cmd += ' -vpre ' + escape_shellarg(options['vpre'])
Severity: Major
Found in video2commons/backend/encode/transcodejob.py and 8 other locations - About 35 mins to fix
video2commons/backend/encode/transcodejob.py on lines 278..279
video2commons/backend/encode/transcodejob.py on lines 315..316
video2commons/backend/encode/transcodejob.py on lines 326..328
video2commons/backend/encode/transcodejob.py on lines 345..349
video2commons/backend/encode/transcodejob.py on lines 389..390
video2commons/backend/encode/transcodejob.py on lines 406..407
video2commons/backend/encode/transcodejob.py on lines 412..413
video2commons/backend/encode/transcodejob.py on lines 415..416

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 33.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

        if 'framerate' in options:
            cmd += ' -r ' + escape_shellarg(options['framerate'])
Severity: Major
Found in video2commons/backend/encode/transcodejob.py and 8 other locations - About 35 mins to fix
video2commons/backend/encode/transcodejob.py on lines 214..215
video2commons/backend/encode/transcodejob.py on lines 278..279
video2commons/backend/encode/transcodejob.py on lines 315..316
video2commons/backend/encode/transcodejob.py on lines 326..328
video2commons/backend/encode/transcodejob.py on lines 345..349
video2commons/backend/encode/transcodejob.py on lines 406..407
video2commons/backend/encode/transcodejob.py on lines 412..413
video2commons/backend/encode/transcodejob.py on lines 415..416

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 33.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

        if 'crf' in options:
            cmd += " -crf " + escape_shellarg(options['crf'])
Severity: Major
Found in video2commons/backend/encode/transcodejob.py and 8 other locations - About 35 mins to fix
video2commons/backend/encode/transcodejob.py on lines 214..215
video2commons/backend/encode/transcodejob.py on lines 278..279
video2commons/backend/encode/transcodejob.py on lines 326..328
video2commons/backend/encode/transcodejob.py on lines 345..349
video2commons/backend/encode/transcodejob.py on lines 389..390
video2commons/backend/encode/transcodejob.py on lines 406..407
video2commons/backend/encode/transcodejob.py on lines 412..413
video2commons/backend/encode/transcodejob.py on lines 415..416

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 33.

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

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

            if 'tileColumns' in options:
                cmd += ' -tile-columns ' + \
                    escape_shellarg(options['tileColumns'])
Severity: Major
Found in video2commons/backend/encode/transcodejob.py and 8 other locations - About 35 mins to fix
video2commons/backend/encode/transcodejob.py on lines 214..215
video2commons/backend/encode/transcodejob.py on lines 278..279
video2commons/backend/encode/transcodejob.py on lines 315..316
video2commons/backend/encode/transcodejob.py on lines 345..349
video2commons/backend/encode/transcodejob.py on lines 389..390
video2commons/backend/encode/transcodejob.py on lines 406..407
video2commons/backend/encode/transcodejob.py on lines 412..413
video2commons/backend/encode/transcodejob.py on lines 415..416

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 33.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../")
Severity: Minor
Found in www/python/src/app.py and 1 other location - About 35 mins to fix
utils/cleanuptasks.py on lines 26..26

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 33.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

sys.path.append(os.path.dirname(os.path.realpath(__file__)) +
Severity: Minor
Found in utils/cleanuptasks.py and 1 other location - About 35 mins to fix
www/python/src/app.py on lines 26..26

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 33.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        elif state == 'PROGRESS':
            task.update({
                'status': 'progress',
                'text': res.result['text'],
                'progress': res.result['percent']
Severity: Minor
Found in video2commons/frontend/api.py and 1 other location - About 35 mins to fix
video2commons/frontend/api.py on lines 194..198

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 33.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                            video2commons.apiPost( 'task/run', newTaskData )
                                .done( function ( data ) {
                                    if ( data.error ) {
                                        // eslint-disable-next-line no-alert
                                        window.alert( data.error );
Severity: Minor
Found in video2commons/frontend/static/video2commons.js and 1 other location - About 35 mins to fix
video2commons/frontend/static/video2commons.js on lines 412..421

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 46.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            video2commons.apiPost( 'task/' + eventName, {
                id: video2commons.getTaskIDFromDOMID( $obj.attr( 'id' ) )
            } )
                .done( function ( data ) {
                    if ( data.error ) {
Severity: Minor
Found in video2commons/frontend/static/video2commons.js and 1 other location - About 35 mins to fix
video2commons/frontend/static/video2commons.js on lines 657..664

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 46.

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

Further Reading

Severity
Category
Status
Source
Language