lucasmiranda42/deepof

View on GitHub

Showing 344 of 362 total issues

Function edit_arenas has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def edit_arenas(
        self, videos: list = None, arena_type: str = None, verbose: bool = True
    ):  # pragma: no cover
        """Tag the arena in the videos.

Severity: Minor
Found in deepof/data.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 call has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def call(self, inputs, training=False):  # pragma: no cover
        """Compute the output of the layer."""
        z_gauss_mean = self.z_gauss_mean(inputs)
        z_gauss_var = self.z_gauss_var(inputs)

Severity: Minor
Found in deepof/models.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 highlight has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function highlight(node, addItems) {
        if (node.nodeType === 3) {
            var val = node.nodeValue;
            var pos = val.toLowerCase().indexOf(text);
            if (pos >= 0 &&
Severity: Minor
Found in docs/build/html/_static/_sphinx_javascript_frameworks_compat.js - About 1 hr to fix

    Function preprocess has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def preprocess(
    Severity: Major
    Found in deepof/data.py - About 1 hr to fix

      Function condition_distance_binning has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def condition_distance_binning(
      Severity: Major
      Found in deepof/post_hoc.py - About 1 hr to fix

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

            def __init__(
        Severity: Major
        Found in deepof/models.py - About 1 hr to fix

          Function ajaxHandleResponses has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function ajaxHandleResponses( s, jqXHR, responses ) {
          
              var ct, type, finalDataType, firstDataType,
                  contents = s.contents,
                  dataTypes = s.dataTypes;
          Severity: Minor
          Found in docs/build/html/_static/jquery-3.6.0.js - About 1 hr to fix

            Function _displayItem has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const _displayItem = (item, searchTerms) => {
              const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
              const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
              const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
              const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
            Severity: Minor
            Found in docs/build/html/_static/searchtools.js - About 1 hr to fix

              Function kleinberg has 37 lines of code (exceeds 25 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 1 hr to fix

                Function boxModelAdjustment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
                    var i = dimension === "width" ? 1 : 0,
                        extra = 0,
                        delta = 0;
                
                
                Severity: Minor
                Found in docs/build/html/_static/jquery-3.6.0.js - About 1 hr to fix

                  Function objectSearchCallback has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      const objectSearchCallback = (prefix, match) => {
                        const name = match[4]
                        const fullname = (prefix ? prefix + "." : "") + name;
                        const fullnameLower = fullname.toLowerCase();
                        if (fullnameLower.indexOf(object) < 0) return;
                  Severity: Minor
                  Found in docs/build/html/_static/searchtools.js - About 1 hr to fix

                    Function mightThrow has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                                    mightThrow = function() {
                                                        var returned, then;
                    
                                                        // Support: Promises/A+ section 2.3.3.3.3
                                                        // https://promisesaplus.com/#point-59
                    Severity: Minor
                    Found in docs/build/html/_static/jquery-3.6.0.js - About 1 hr to fix

                      Function create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def create(
                              self,
                              verbose: bool = True,
                              force: bool = False,
                              debug: bool = True,
                      Severity: Minor
                      Found in deepof/data.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 automatically_recognize_arena has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def automatically_recognize_arena(
                          coordinates: coordinates,
                          tables: table_dict,
                          videos: list,
                          vid_index: int,
                      Severity: Minor
                      Found in deepof/utils.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 getWidthOrHeight has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getWidthOrHeight( elem, dimension, extra ) {
                      
                          // Start with computed style
                          var styles = getStyles( elem ),
                      
                      
                      Severity: Minor
                      Found in docs/build/html/_static/jquery-3.6.0.js - About 1 hr to fix

                        Function __init__ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def __init__(
                                self,
                                animal_ids: List = None,
                                arena: str = "polygonal-autodetect",
                                bodypart_graph: Union[str, dict] = "deepof_14",
                        Severity: Minor
                        Found in deepof/data.py - About 1 hr to fix

                          Function initOnKeyListeners has 35 lines of code (exceeds 25 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 1 hr to fix

                            Function plot_distance_between_conditions has 11 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def plot_distance_between_conditions(
                            Severity: Major
                            Found in deepof/visuals.py - About 1 hr to fix

                              Function sniff_object has 11 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def sniff_object(
                              Severity: Major
                              Found in deepof/annotation_utils.py - About 1 hr to fix

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

                                    def __init__(
                                Severity: Major
                                Found in deepof/data.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language