median-research-group/LibMTL

View on GitHub

Showing 247 of 412 total issues

Function domManip has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function domManip( collection, args, callback, ignored ) {

    // Flatten any nested arrays
    args = flat( args );

Severity: Major
Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

    Function ajaxConvert has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ajaxConvert( s, response, jqXHR, isSuccess ) {
        var conv2, current, conv, tmp, prev,
            converters = {},
    
            // Work with a copy of dataTypes in case we need to modify it for conversion
    Severity: Major
    Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

      Function displayNextItem has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function displayNextItem() {
            // results left, load the summary and display it
            if (results.length) {
              var item = results.pop();
              var listItem = $('<li></li>');
      Severity: Major
      Found in docs/_build/html/_static/searchtools.js - About 2 hrs to fix

        Function highlightText has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        jQuery.fn.highlightText = function(text, className) {
          function highlight(node, addItems) {
            if (node.nodeType === 3) {
              var val = node.nodeValue;
              var pos = val.toLowerCase().indexOf(text);
        Severity: Minor
        Found in docs/_build/html/_static/doctools.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

        Function backward has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def backward(self, losses, **kwargs):
                beta = kwargs['GradVac_beta']
                group_type = kwargs['GradVac_group_type']
                if self.step == 0:
                    self._init_rho(group_type)
        Severity: Minor
        Found in LibMTL/weighting/GradVac.py - 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

        File trainer.py has 260 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import torch, os
        import torch.nn as nn
        import torch.nn.functional as F
        import numpy as np
        
        
        Severity: Minor
        Found in LibMTL/trainer.py - About 2 hrs to fix

          Function init has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              init = jQuery.fn.init = function( selector, context, root ) {
                  var match, elem;
          
                  // HANDLE: $(""), $(null), $(undefined), $(false)
                  if ( !selector ) {
          Severity: Major
          Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

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

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

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

              def panx_preprocess(args):
                  def _process_one_file(infile, outfile):
                      lines = open(infile, 'r').readlines()
                      if lines[-1].strip() == '':
                          lines = lines[:-1]
              Severity: Minor
              Found in examples/xtreme/propocess_data/utils_preprocess.py - 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

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

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

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

                function buildFragment( elems, context, scripts, selection, ignored ) {
                    var elem, tmp, tag, wrap, attached, j,
                        fragment = context.createDocumentFragment(),
                        nodes = [],
                        i = 0,
                Severity: Major
                Found in docs/_build/html/_static/jquery-3.5.1.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 ) ) {
                  Severity: Critical
                  Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

                    Function select has 48 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/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

                      Function matcherFromTokens has 48 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/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

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

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

                          Function remove_qa_test_annotations has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def remove_qa_test_annotations(test_dir):
                              assert os.path.exists(test_dir)
                              for file_name in os.listdir(test_dir):
                                  new_data = []
                                  test_file = os.path.join(test_dir, file_name)
                          Severity: Minor
                          Found in examples/xtreme/propocess_data/utils_preprocess.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 addCombinator has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function addCombinator( matcher, combinator, base ) {
                              var dir = combinator.dir,
                                  skip = combinator.next,
                                  key = skip || dir,
                                  checkNonElements = base && key === "parentNode",
                          Severity: Minor
                          Found in docs/_build/html/_static/jquery-3.5.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/_build/html/_static/jquery-3.5.1.js - About 1 hr to fix

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

                                function template(text, settings, oldSettings) {
                                  if (!settings && oldSettings) settings = oldSettings;
                                  settings = defaults({}, settings, _$1.templateSettings);
                              
                                  // Combine delimiters into one regular expression via alternation.
                              Severity: Minor
                              Found in docs/_build/html/_static/underscore-1.13.1.js - About 1 hr to fix

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

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