Showing 44 of 99 total issues
File video2commons.js
has 821 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* globals nunjucks: false, io: false, Qs: false */
( function ( $ ) {
'use strict';
var config = window.config,
Function run_shell_exec
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def run_shell_exec(self, cmd, track=True):
"""
Run the shell exec command.
@param cmd String Command to be run
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File api.py
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2015-2016 Zhuyifei1999
#
File transcodejob.py
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
#! /usr/bin/python
# -*- coding: UTF-8 -*-
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General License as published by
Function processInput
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
processInput: function ( button ) {
var resolved = $.when(); // A resolved jQuery promise
var deferred;
switch ( newTaskData.step ) {
Function main
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def main(
self, url, ie_key, subtitles, filename, filedesc,
downloadkey, convertkey, username, oauth
):
"""Main worker code."""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function download
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def download(
url, ie_key, formats, subtitles, outputdir,
statuscallback=None, errorcallback=None
):
"""Download a video from url to outputdir."""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function subtitles
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def subtitles(
subtitles, wikifilename, username,
statuscallback=None, errorcallback=None
):
"""Convert and upload subtitles to corresponding TimedText pages."""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _status
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _status(id):
title = get_title_from_task(id)
if not title:
# task has been forgotten -- results should have been expired
return None
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function updateTask
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateTask: function ( val ) {
var table = $( '#tasktable > tbody' );
var id = 'task-' + val.id,
$row = $( '#' + id );
Function getbestkey
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def getbestkey(info, targettype):
"""Find the bext convert key to use."""
# Asserts
assert info, 'The file format could not be recognized'
assert targettype, 'The target format is invalid.'
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function ffmpeg_add_webm_video_options
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def ffmpeg_add_webm_video_options(self, options, p):
"""
Add ffmpeg shell options for webm.
@param options
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
"""
Run the transcode request.
@return boolean success
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function setupAddTaskDialog
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupAddTaskDialog: function () {
switch ( newTaskData.step ) {
case 'source':
$addTaskDialog.find( '.modal-body' )
.html( nunjucksEnv.render( 'sourceForm.html' ) );
Function initUpload
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
initUpload: function () {
var deferred;
window.jqXHR = $addTaskDialog.find( '#fileupload' ).fileupload( {
dataType: 'json',
Function ffmpeg_encode
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def ffmpeg_encode(self, options, p=0):
"""
Utility helper for ffmpeg and ffmpeg2theora mapping.
@param options array
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File urlextract.py
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2015-2016 Zhuyifei1999
#
Function setupTaskRow
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupTaskRow: function ( $row, id, status ) {
switch ( status ) {
case 'progress':
/* eslint-disable indent */
$row.append( $( '<td />' )
Function _source
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _source(url, ie_key, title, info):
if info['id']:
if ie_key == 'Youtube':
return '{{From YouTube|1=%(id)s|2=%(title)s}}' % \
{'id': info['id'], 'title': escape_wikitext(title)}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function reactivatePrevNextButtons
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
reactivatePrevNextButtons: function () {
$addTaskDialog.find( '#dialog-spinner' )
.hide();
switch ( newTaskData.step ) {
case 'source':