lucasmiranda42/deepof

View on GitHub

Showing 345 of 363 total issues

Function retrieve_corners_from_image has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

def retrieve_corners_from_image(
    frame: np.ndarray, arena_type: str, cur_vid: int, videos: list
):  # pragma: no cover
    """Open a window and waits for the user to click on all corners of the polygonal arena.

Severity: Minor
Found in deepof/utils.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

    File deepof_train_embeddings.py has 412 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # @author lucasmiranda42
    # encoding: utf-8
    # module deepof
    
    """
    Severity: Minor
    Found in deepof/deepof_train_embeddings.py - About 5 hrs to fix

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

      def get_arenas(
          coordinates: coordinates,
          tables: table_dict,
          arena: str,
          arena_dims: int,
      Severity: Minor
      Found in deepof/utils.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 kleinberg has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

      def kleinberg(
          offsets: list, s: float = np.e, gamma: float = 1.0, n=None, T=None, k=None
      ):
          """Apply Kleinberg's algorithm (described in 'Bursty and Hierarchical Structure in Streams').
      
      
      Severity: Minor
      Found in deepof/utils.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 animate_skeleton has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

      def animate_skeleton(
          coordinates: coordinates,
          experiment_id: str,
          animal_id: list = None,
          center: str = "arena",
      Severity: Minor
      Found in deepof/visuals.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

      File searchtools.js has 389 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 initOnKeyListeners has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

          initOnKeyListeners: () => {
            // only install a listener if it is really needed
            if (
              !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
              !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
        Severity: Minor
        Found in docs/build/html/_static/doctools.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

        Function plot_transitions has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

        def plot_transitions(
            coordinates: coordinates,
            embeddings: table_dict,
            soft_counts: table_dict,
            breaks: table_dict = None,
        Severity: Minor
        Found in deepof/visuals.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 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.6.0.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.6.0.js - About 4 hrs to fix

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

                def load_tables(self, verbose: bool = True) -> Tuple:
                    """Load videos and tables into dictionaries.
            
                    Args:
                        verbose (bool): If True, prints the progress of data loading.
            Severity: Minor
            Found in deepof/data.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 get_distances has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_distances(
                    self,
                    speed: int = 0,
                    selected_id: str = None,
                    filter_on_graph: bool = True,
            Severity: Minor
            Found in deepof/data.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 embedding_model_fitting has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
              Open

              def embedding_model_fitting(
                  preprocessed_object: Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray],
                  adjacency_matrix: np.ndarray,
                  embedding_model: str,
                  encoder_type: str,
              Severity: Minor
              Found in deepof/model_utils.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 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.6.0.js - About 4 hrs to fix

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

                  query: (query) => {
                    const filenames = Search._index.filenames;
                    const docNames = Search._index.docnames;
                    const titles = Search._index.titles;
                    const allTitles = Search._index.alltitles;
                Severity: Minor
                Found in docs/build/html/_static/searchtools.js - 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 get_angles has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get_angles(
                        self,
                        degrees: bool = False,
                        speed: int = 0,
                        selected_id: str = None,
                Severity: Minor
                Found in deepof/data.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.6.0.js - About 3 hrs to fix

                  Function trigger has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      trigger: function( event, data, elem, onlyHandlers ) {
                  
                          var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
                              eventPath = [ elem || document ],
                              type = hasOwn.call( event, "type" ) ? event.type : event,
                  Severity: Major
                  Found in docs/build/html/_static/jquery-3.6.0.js - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language