median-research-group/LibMTL

View on GitHub

Showing 353 of 412 total issues

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

                    atten_decoder[i][j][0] = self.decoder_block_att[-j - 1](atten_decoder[i][j][0])
Severity: Major
Found in examples/nyu/segnet_mtan.py and 1 other location - About 3 hrs to fix
examples/nyu/segnet_mtan.py on lines 139..139

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

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 send has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            send: function( headers, complete ) {
                var i,
                    xhr = options.xhr();

                xhr.open(
Severity: Major
Found in docs/_build/html/_static/jquery-3.5.1.js - About 3 hrs to fix

    Function performTermsSearch has 75 lines of code (exceeds 25 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: Major
    Found in docs/_build/html/_static/searchtools.js - About 3 hrs to fix

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

      class KLDivLoss(AbsLoss):
          r"""The Kullback-Leibler divergence loss function.
          """
          def __init__(self):
              super(KLDivLoss, self).__init__()
      Severity: Major
      Found in LibMTL/loss.py and 3 other locations - About 3 hrs to fix
      LibMTL/loss.py on lines 40..52
      LibMTL/loss.py on lines 68..80
      LibMTL/loss.py on lines 82..94

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

      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 4 locations. Consider refactoring.
      Open

      class L1Loss(AbsLoss):
          r"""The Mean Absolute Error (MAE) loss function.
          """
          def __init__(self):
              super(L1Loss, self).__init__()
      Severity: Major
      Found in LibMTL/loss.py and 3 other locations - About 3 hrs to fix
      LibMTL/loss.py on lines 40..52
      LibMTL/loss.py on lines 54..66
      LibMTL/loss.py on lines 82..94

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

      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 4 locations. Consider refactoring.
      Open

      class MSELoss(AbsLoss):
          r"""The Mean Squared Error (MSE) loss function.
          """
          def __init__(self):
              super(MSELoss, self).__init__()
      Severity: Major
      Found in LibMTL/loss.py and 3 other locations - About 3 hrs to fix
      LibMTL/loss.py on lines 40..52
      LibMTL/loss.py on lines 54..66
      LibMTL/loss.py on lines 68..80

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

      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 4 locations. Consider refactoring.
      Open

      class CELoss(AbsLoss):
          r"""The cross-entropy loss function.
          """
          def __init__(self):
              super(CELoss, self).__init__()
      Severity: Major
      Found in LibMTL/loss.py and 3 other locations - About 3 hrs to fix
      LibMTL/loss.py on lines 54..66
      LibMTL/loss.py on lines 68..80
      LibMTL/loss.py on lines 82..94

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

      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 add has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          add: function( elem, types, handler, data, selector ) {
      
              var handleObjIn, eventHandle, 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 matcherFromGroupMatchers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
            var bySet = setMatchers.length > 0,
                byElement = elementMatchers.length > 0,
                superMatcher = function( seed, context, xml, results, outermost ) {
                    var elem, j, matcher,
        Severity: Major
        Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

          Function splitChars has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var splitChars = (function() {
              var result = {};
              var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
                   1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
                   2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
          Severity: Major
          Found in docs/_build/html/_static/language_data.js - About 2 hrs to fix

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

                if params.mode == 'train':
                    officeModel.train(train_dataloaders=train_dataloaders, 
                                      val_dataloaders=val_dataloaders,
                                      test_dataloaders=test_dataloaders, 
                                      epochs=params.epochs)
            Severity: Major
            Found in examples/office/main.py and 1 other location - About 2 hrs to fix
            examples/xtreme/main.py on lines 103..111

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

            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

                if params.mode == 'train':
                    SCModel.train(train_dataloaders=train_dataloaders, 
                                  val_dataloaders=val_dataloaders,
                                  test_dataloaders=test_dataloaders, 
                                  epochs=params.epochs)
            Severity: Major
            Found in examples/xtreme/main.py and 1 other location - About 2 hrs to fix
            examples/office/main.py on lines 80..88

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

            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

            File conll.py has 284 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # https://github.com/google-research/xtreme/issues/63
            
            try:
                import networkx as nx
            except ModuleNotFoundError:
            Severity: Minor
            Found in examples/xtreme/propocess_data/conll.py - About 2 hrs to fix

              Function setMatcher has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                  if ( postFilter && !postFilter[ expando ] ) {
                      postFilter = setMatcher( postFilter );
                  }
                  if ( postFinder && !postFinder[ expando ] ) {
              Severity: Major
              Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

                Function done has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function done( status, nativeStatusText, responses, headers ) {
                            var isSuccess, success, error, response, modified,
                                statusText = nativeStatusText;
                
                            // Ignore repeat invocations
                Severity: Major
                Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

                  Function resolve has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                      function resolve( depth, deferred, handler, special ) {
                                          return function() {
                                              var that = this,
                                                  args = arguments,
                                                  mightThrow = function() {
                  Severity: Major
                  Found in docs/_build/html/_static/jquery-3.5.1.js - About 2 hrs to fix

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

                                        atten_decoder[i][j][2] = (atten_decoder[i][j][1]) * g_decoder[j][-1]
                    Severity: Major
                    Found in examples/nyu/segnet_mtan.py and 3 other locations - About 2 hrs to fix
                    examples/nyu/segnet_mtan.py on lines 127..127
                    examples/nyu/segnet_mtan.py on lines 132..132
                    examples/nyu/segnet_mtan.py on lines 146..146

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

                    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 4 locations. Consider refactoring.
                    Open

                                        atten_decoder[i][j][2] = (atten_decoder[i][j][1]) * g_decoder[j][-1]
                    Severity: Major
                    Found in examples/nyu/segnet_mtan.py and 3 other locations - About 2 hrs to fix
                    examples/nyu/segnet_mtan.py on lines 127..127
                    examples/nyu/segnet_mtan.py on lines 132..132
                    examples/nyu/segnet_mtan.py on lines 141..141

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

                    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 4 locations. Consider refactoring.
                    Open

                                        atten_encoder[i][j][1] = (atten_encoder[i][j][0]) * g_encoder[j][1]
                    Severity: Major
                    Found in examples/nyu/segnet_mtan.py and 3 other locations - About 2 hrs to fix
                    examples/nyu/segnet_mtan.py on lines 132..132
                    examples/nyu/segnet_mtan.py on lines 141..141
                    examples/nyu/segnet_mtan.py on lines 146..146

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

                    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 4 locations. Consider refactoring.
                    Open

                                        atten_encoder[i][j][1] = (atten_encoder[i][j][0]) * g_encoder[j][1]
                    Severity: Major
                    Found in examples/nyu/segnet_mtan.py and 3 other locations - About 2 hrs to fix
                    examples/nyu/segnet_mtan.py on lines 127..127
                    examples/nyu/segnet_mtan.py on lines 141..141
                    examples/nyu/segnet_mtan.py on lines 146..146

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language