tomi77/pyems

View on GitHub

Showing 178 of 178 total issues

Function e has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"sphinx-rtd-theme":[function(require,module,exports){
Severity: Minor
Found in docs/html/_static/js/theme.js - About 2 hrs to fix

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

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

    @expected('source', 'destinations', 'targetStreamNames', 'groupName',
              'videoBitrates', 'videoSizes', 'videoAdvancedParamsProfiles',
              'audioBitrates', 'audioChannelsCounts', 'audioFrequencies',
              'audioAdvancedParamsProfiles', 'overlays', 'croppings',
              'keepAlive', 'commandFlags')
Severity: Major
Found in pyems/__init__.py and 1 other location - About 2 hrs to fix
pyems/__init__.py on lines 333..411

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

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

    @expected('localStreamNames', 'targetFolder', 'bandwidths',
              'chunkBaseName', 'chunkLength', 'chunkOnIDR', 'groupName',
              'keepAlive', 'manifestName', 'overwriteDestination',
              'playlistType', 'playlistLength', 'staleRetentionCount',
              'createMasterPlaylist', 'cleanupDestination')
Severity: Major
Found in pyems/__init__.py and 1 other location - About 2 hrs to fix
pyems/__init__.py on lines 637..721

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

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

Function remove has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    remove: function( elem, types, handler, selector, mappedTypes ) {
        var j, handleObj, tmp,
            origCount, t, events,
            special, handlers, type,
            namespaces, origType,
Severity: Major
Found in docs/html/_static/jquery-1.11.1.js - About 2 hrs to fix

    Function performObjectSearch has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      performObjectSearch : function(object, otherterms) {
        var filenames = this._index.filenames;
        var objects = this._index.objects;
        var objnames = this._index.objnames;
        var titles = this._index.titles;
    Severity: Minor
    Found in docs/html/_static/searchtools.js - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

                      if ( ( mappedTypes || origType === handleObj.origType ) &&
                          ( !handler || handler.guid === handleObj.guid ) &&
                          ( !tmp || tmp.test( handleObj.namespace ) ) &&
                          ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                          handlers.splice( j, 1 );
      Severity: Critical
      Found in docs/html/_static/jquery-1.11.1.js - About 2 hrs to fix

        Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function internalRemoveData( elem, name, pvt ) {
            if ( !jQuery.acceptData( elem ) ) {
                return;
            }
        
        
        Severity: Minor
        Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

          Function initEvents has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function initEvents() {
              $(document).on("click", 'a.comment-close', function(event) {
                event.preventDefault();
                hide($(this).attr('id').substring(2));
              });
          Severity: Minor
          Found in docs/html/_static/websupport.js - About 1 hr to fix

            Function select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            select = Sizzle.select = function( selector, context, results, seed ) {
                var i, tokens, token, type, find,
                    compiled = typeof selector === "function" && selector,
                    match = !seed && tokenize( (selector = compiled.selector || selector) );
            
            
            Severity: Minor
            Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

              Function internalData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
                  if ( !jQuery.acceptData( elem ) ) {
                      return;
                  }
              
              
              Severity: Minor
              Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

                Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                    var matched, match, tokens, type,
                        soFar, groups, preFilters,
                        cached = tokenCache[ selector + " " ];
                
                
                Severity: Minor
                Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

                  Function matcherFromTokens has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function matcherFromTokens( tokens ) {
                      var checkContext, matcher, j,
                          len = tokens.length,
                          leadingRelative = Expr.relative[ tokens[0].type ],
                          implicitRelative = leadingRelative || Expr.relative[" "],
                  Severity: Minor
                  Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

                    Function addComment has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function addComment(form) {
                        var node_id = form.find('input[name="node"]').val();
                        var parent_id = form.find('input[name="parent"]').val();
                        var text = form.find('textarea[name="comment"]').val();
                        var proposal = form.find('textarea[name="proposal"]').val();
                    Severity: Minor
                    Found in docs/html/_static/websupport.js - About 1 hr to fix

                      Function initOnKeyListeners has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        initOnKeyListeners: function() {
                          $(document).keyup(function(event) {
                            var activeElementType = document.activeElement.tagName;
                            // don't navigate when in search box or textarea
                            if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
                      Severity: Minor
                      Found in docs/html/_static/doctools.js - About 1 hr to fix

                      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

                      Consider simplifying this complex logical expression.
                      Open

                                  if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                      ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                      ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                      !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
                      
                      
                      Severity: Critical
                      Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                        if (!jQuery.browser) {
                          jQuery.uaMatch = function(ua) {
                            ua = ua.toLowerCase();
                        
                            var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
                        Severity: Critical
                        Found in docs/html/_static/doctools.js - About 1 hr to fix

                          Function val has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              val: function( value ) {
                                  var hooks, ret, isFunction,
                                      elem = this[0];
                          
                                  if ( !arguments.length ) {
                          Severity: Minor
                          Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

                            Function stop has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                stop: function( type, clearQueue, gotoEnd ) {
                                    var stopQueue = function( hooks ) {
                                        var stop = hooks.stop;
                                        delete hooks.stop;
                                        stop( gotoEnd );
                            Severity: Minor
                            Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

                              Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
                                      var type, origFn;
                              
                                      // Types can be a map of types/handlers
                                      if ( typeof types === "object" ) {
                              Severity: Minor
                              Found in docs/html/_static/jquery-1.11.1.js - About 1 hr to fix

                                Function comment has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  $.fn.comment = function() {
                                    return this.each(function() {
                                      var id = $(this).attr('id').substring(1);
                                      var count = COMMENT_METADATA[id];
                                      var title = count + ' comment' + (count == 1 ? '' : 's');
                                Severity: Minor
                                Found in docs/html/_static/websupport.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language