ssut/py-googletrans

View on GitHub

Showing 171 of 193 total issues

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

    setOffset: function( elem, options, i ) {
        var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
            position = jQuery.css( elem, "position" ),
            curElem = jQuery( elem ),
            props = {};
Severity: Minor
Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

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

        toggleClass: function( value, stateVal ) {
            var type = typeof value,
                isValidValue = type === "string" || Array.isArray( value );
    
            if ( typeof stateVal === "boolean" && isValidValue ) {
    Severity: Minor
    Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

      Function translate_doc has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def translate_doc(filename, destination='zh-CN', mix=True):
          """
          translate a word document type of file and save the result as document and keep the exactly same file format.
              :param filename: word doc file
              :param destination='zh-CN':
      Severity: Minor
      Found in example/translate_word_doc.py - 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

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

        initOnKeyListeners: function() {
          $(document).keydown(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/_build/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

      Function highlight has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function highlight(node, addItems) {
          if (node.nodeType === 3) {
            var val = node.nodeValue;
            var pos = val.toLowerCase().indexOf(text);
            if (pos >= 0 &&
      Severity: Minor
      Found in docs/_build/html/_static/doctools.js - About 1 hr to fix

        Function ajaxHandleResponses has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function ajaxHandleResponses( s, jqXHR, responses ) {
        
            var ct, type, finalDataType, firstDataType,
                contents = s.contents,
                dataTypes = s.dataTypes;
        Severity: Minor
        Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

          Function boxModelAdjustment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
              var i = dimension === "width" ? 1 : 0,
                  extra = 0,
                  delta = 0;
          
          
          Severity: Minor
          Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

            Function mightThrow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                            mightThrow = function() {
                                                var returned, then;
            
                                                // Support: Promises/A+ section 2.3.3.3.3
                                                // https://promisesaplus.com/#point-59
            Severity: Minor
            Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

              Function getWidthOrHeight has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function getWidthOrHeight( elem, dimension, extra ) {
              
                  // Start with computed style
                  var styles = getStyles( elem ),
              
              
              Severity: Minor
              Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                Function handlers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    handlers: function( event, handlers ) {
                        var i, handleObj, sel, matchedHandlers, matchedSelectors,
                            handlerQueue = [],
                            delegateCount = handlers.delegateCount,
                            cur = event.target;
                Severity: Minor
                Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if ( ( !support.boxSizingReliable() && isBorderBox ||
                  
                          // Support: IE 10 - 11+, Edge 15 - 18+
                          // IE/Edge misreport `getComputedStyle` of table rows with width/height
                          // set in CSS while `offset*` properties report correct values.
                  Severity: Critical
                  Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                    Function showHide has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function showHide( elements, show ) {
                        var display, elem,
                            values = [],
                            index = 0,
                            length = elements.length;
                    Severity: Minor
                    Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                      Function handler has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              handler: function( event ) {
                                  var notAsync, result,
                                      saved = dataPriv.get( this, type );
                      
                                  if ( ( event.isTrigger & 1 ) && this[ type ] ) {
                      Severity: Minor
                      Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                        Function load has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        jQuery.fn.load = function( url, params, callback ) {
                            var selector, type, response,
                                self = this,
                                off = url.indexOf( " " );
                        
                        
                        Severity: Minor
                        Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                          Function removeClass has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              removeClass: function( value ) {
                                  var classes, elem, cur, curValue, clazz, j, finalValue,
                                      i = 0;
                          
                                  if ( isFunction( value ) ) {
                          Severity: Minor
                          Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                            Function speed has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            jQuery.speed = function( speed, easing, fn ) {
                                var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
                                    complete: fn || !fn && easing ||
                                        isFunction( speed ) && speed,
                                    duration: speed,
                            Severity: Minor
                            Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                              Function set has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      set: function( elem, value, extra ) {
                                          var matches,
                                              styles = getStyles( elem ),
                              
                                              // Only read styles.position if the test has a chance to fail
                              Severity: Minor
                              Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                                Function attr has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    attr: function( elem, name, value ) {
                                        var ret, hooks,
                                            nType = elem.nodeType;
                                
                                        // Don't get/set attributes on text, comment and attribute nodes
                                Severity: Minor
                                Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                                  Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      finish: function( type ) {
                                          if ( type !== false ) {
                                              type = type || "fx";
                                          }
                                          return this.each( function() {
                                  Severity: Minor
                                  Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                                    Function parseHTML has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    jQuery.parseHTML = function( data, context, keepScripts ) {
                                        if ( typeof data !== "string" ) {
                                            return [];
                                        }
                                        if ( typeof context === "boolean" ) {
                                    Severity: Minor
                                    Found in docs/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language