lucasmiranda42/deepof

View on GitHub

Showing 363 of 363 total issues

Function annotate_video has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def annotate_video(
    coordinates: coordinates,
    tag_dict: pd.DataFrame,
    vid_index: int,
    frame_limit: int = np.inf,
Severity: Minor
Found in deepof/visuals.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 __init__ has 22 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in deepof/data.py - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                            if ( forward && useCache ) {
    
                                // Seek `elem` from a previously-cached index
    
                                // ...in a gzip-friendly way
    Severity: Critical
    Found in docs/build/html/_static/jquery-3.6.0.js - About 2 hrs to fix

      Function deepEq has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function deepEq(a, b, aStack, bStack) {
          // Unwrap any wrapped objects.
          if (a instanceof _$1) a = a._wrapped;
          if (b instanceof _$1) b = b._wrapped;
          // Compare `[[Class]]` names.
      Severity: Major
      Found in docs/build/html/_static/underscore-1.13.1.js - About 2 hrs to fix

        Function __init__ has 21 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Major
        Found in deepof/data.py - About 2 hrs to fix

          Function superMatcher has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  superMatcher = function( seed, context, xml, results, outermost ) {
                      var elem, j, matcher,
                          matchedCount = 0,
                          i = "0",
                          unmatched = seed && [],
          Severity: Major
          Found in docs/build/html/_static/jquery-3.6.0.js - About 2 hrs to fix

            Function supervised_tagging has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            def supervised_tagging(
                coord_object: coordinates,
                raw_coords: table_dict,
                coords: table_dict,
                dists: table_dict,
            Severity: Minor
            Found in deepof/annotation_utils.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 plot_enrichment has 20 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def plot_enrichment(
            Severity: Major
            Found in deepof/visuals.py - About 2 hrs to fix

              Function performObjectSearch has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                performObjectSearch: (object, objectTerms) => {
                  const filenames = Search._index.filenames;
                  const docNames = Search._index.docnames;
                  const objects = Search._index.objects;
                  const objNames = Search._index.objnames;
              Severity: Minor
              Found in docs/build/html/_static/searchtools.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 _process_animation_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              def _process_animation_data(
                  coordinates,
                  experiment_id,
                  animal_id,
                  center,
              Severity: Minor
              Found in deepof/visuals.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 get_training_set has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_training_set(
                      self, current_table_dict: table_dict, test_videos: int = 0
                  ) -> tuple:
                      """Generate training and test sets as numpy.array objects for model training.
              
              
              Severity: Minor
              Found in deepof/data.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 plot_enrichment has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              def plot_enrichment(
                  coordinates: coordinates,
                  embeddings: table_dict = None,
                  soft_counts: table_dict = None,
                  breaks: table_dict = None,
              Severity: Minor
              Found in deepof/visuals.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 get_areas has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_areas(self, speed: int = 0, selected_id: str = "all") -> table_dict:
                      """Return a table_dict object with all relevant areas (head, torso, back, full). Unless specified otherwise, the areas are computed for all animals.
              
                      Args:
                          speed (int): The derivative to use for speed.
              Severity: Minor
              Found in deepof/data.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 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.6.0.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.6.0.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/_sphinx_javascript_frameworks_compat.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 set_up_project_directory has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def set_up_project_directory(self, debug=False):
                          """Create a project directory where to save all produced results."""
                          # Create a project directory, as well as subfolders for videos and tables
                          project_path = os.path.join(self.project_path, self.project_name)
                  
                  
                  Severity: Minor
                  Found in deepof/data.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 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.6.0.js - About 2 hrs to fix

                    Function plot_heatmaps has 17 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def plot_heatmaps(
                    Severity: Major
                    Found in deepof/visuals.py - About 2 hrs to fix

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

                              Object.keys(titleTerms).forEach((term) => {
                                if (term.match(escapedWord) && !titleTerms[word])
                                  arr.push({ files: titleTerms[word], score: Scorer.partialTitle });
                              });
                      Severity: Major
                      Found in docs/build/html/_static/searchtools.js and 1 other location - About 2 hrs to fix
                      docs/build/html/_static/searchtools.js on lines 461..464

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

                      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