median-research-group/LibMTL

View on GitHub

Showing 247 of 412 total issues

Function udpos_preprocess has a Cognitive Complexity of 98 (exceeds 5 allowed). Consider refactoring.
Open

def udpos_preprocess(args):
    def _read_one_file(file):
        data = []
        sent, tag, lines = [], [], []
        for line in open(file, 'r'):
Severity: Minor
Found in examples/xtreme/propocess_data/utils_preprocess.py - About 1 day 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 Stemmer has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

var Stemmer = function() {

  var step2list = {
    ational: 'ate',
    tional: 'tion',
Severity: Minor
Found in docs/_build/html/_static/language_data.js - About 1 day 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 query has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

  query : function(query) {
    var i;

    // stem the searchterms and add them to the correct list
    var stemmer = new Stemmer();
Severity: Minor
Found in docs/_build/html/_static/searchtools.js - About 7 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 Deferred has 178 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Deferred: function( func ) {
        var tuples = [

                // action, add listener, callbacks,
                // ... .then handlers, argument index, [final state]
Severity: Major
Found in docs/_build/html/_static/jquery-3.5.1.js - About 7 hrs to fix

    File utils_preprocess.py has 463 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # coding=utf-8
    # Copyright 2020 Google and DeepMind.
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    Severity: Minor
    Found in examples/xtreme/propocess_data/utils_preprocess.py - About 7 hrs to fix

      Function performObjectSearch has a Cognitive Complexity of 45 (exceeds 5 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: Minor
      Found in docs/_build/html/_static/searchtools.js - About 6 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 panx_tokenize_preprocess has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      def panx_tokenize_preprocess(args):
          def _preprocess_one_file(infile, outfile, idxfile, tokenizer, max_len):
              if not os.path.exists(infile):
                  print(f'{infile} not exists')
                  return 0
      Severity: Minor
      Found in examples/xtreme/propocess_data/utils_preprocess.py - About 6 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 Stemmer has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Stemmer = function() {
      
        var step2list = {
          ational: 'ate',
          tional: 'tion',
      Severity: Major
      Found in docs/_build/html/_static/language_data.js - About 6 hrs to fix

        Function udpos_tokenize_preprocess has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        def udpos_tokenize_preprocess(args):
            def _preprocess_one_file(infile, outfile, idxfile, tokenizer, max_len):
                if not os.path.exists(infile):
                    print(f'{infile} does not exist')
                    return
        Severity: Minor
        Found in examples/xtreme/propocess_data/utils_preprocess.py - About 5 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 performTermsSearch has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

          performTermsSearch : function(searchterms, excluded, terms, titleterms) {
            var docnames = this._index.docnames;
            var filenames = this._index.filenames;
            var titles = this._index.titles;
        
        
        Severity: Minor
        Found in docs/_build/html/_static/searchtools.js - About 5 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 searchtools.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * searchtools.js
         * ~~~~~~~~~~~~~~~~
         *
         * Sphinx JavaScript utilities for the full-text search.
        Severity: Minor
        Found in docs/_build/html/_static/searchtools.js - About 5 hrs to fix

          Function defaultPrefilter has 122 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function defaultPrefilter( elem, props, opts ) {
              var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
                  isBox = "width" in props || "height" in props,
                  anim = this,
                  orig = {},
          Severity: Major
          Found in docs/_build/html/_static/jquery-3.5.1.js - About 4 hrs to fix

            Function Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jQuery.Callbacks = function( options ) {
            
                // Convert options from String-formatted to Object-formatted if needed
                // (we check in cache first)
                options = typeof options === "string" ?
            Severity: Major
            Found in docs/_build/html/_static/jquery-3.5.1.js - About 4 hrs to fix

              Function query has 121 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                query : function(query) {
                  var i;
              
                  // stem the searchterms and add them to the correct list
                  var stemmer = new Stemmer();
              Severity: Major
              Found in docs/_build/html/_static/searchtools.js - About 4 hrs to fix

                Function DataloaderSC has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                def DataloaderSC(lang_list,
                                model_name_or_path,
                                model_type,
                                mode_list,
                                data_dir,
                Severity: Minor
                Found in examples/xtreme/create_dataset.py - About 4 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 _keep_fused_form has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _keep_fused_form(self,posPreferenceDicts):
                        # For a span A,B  and external tokens C, such as  A > B > C, we have to
                        # Make A the head of the span
                        # Attach C-level tokens to A
                        #Remove B-level tokens, which are the subtokens of the fused form della: de la
                Severity: Minor
                Found in examples/xtreme/propocess_data/conll.py - About 4 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 stemWord has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  this.stemWord = function (w) {
                    var stem;
                    var suffix;
                    var firstch;
                    var origword = w;
                Severity: Major
                Found in docs/_build/html/_static/language_data.js - About 4 hrs to fix

                  Function then has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  then: function( onFulfilled, onRejected, onProgress ) {
                                      var maxDepth = 0;
                                      function resolve( depth, deferred, handler, special ) {
                                          return function() {
                                              var that = this,
                  Severity: Major
                  Found in docs/_build/html/_static/jquery-3.5.1.js - About 4 hrs to fix

                    Function read_conll_u has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def read_conll_u(self,filename,keepFusedForm=False, lang=None, posPreferenceDict=None):
                            sentences = []
                            sent = DependencyTree()
                            multi_tokens = {}
                    
                    
                    Severity: Minor
                    Found in examples/xtreme/propocess_data/conll.py - About 3 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 Animation has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Animation( elem, properties, options ) {
                        var result,
                            stopped,
                            index = 0,
                            length = Animation.prefilters.length,
                    Severity: Major
                    Found in docs/_build/html/_static/jquery-3.5.1.js - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language