tensorflow/models

View on GitHub
research/lfads/synth_data/synthetic_data_utils.py

Summary

Maintainability
C
7 hrs
Test Coverage

File synthetic_data_utils.py has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Minor
Found in research/lfads/synth_data/synthetic_data_utils.py - About 2 hrs to fix

    Function add_alignment_projections has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def add_alignment_projections(datasets, npcs, ntime=None, nsamples=None):
      """Create a matrix that aligns the datasets a bit, under
      the assumption that each dataset is observing the same underlying dynamical
      system.
    
    
    Severity: Minor
    Found in research/lfads/synth_data/synthetic_data_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 generate_data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def generate_data(rnn, T, E, x0s=None, P_sxn=None, input_magnitude=0.0,
                      input_times=None):
      """ Generates data from an randomly initialized RNN.
      Args:
        rnn: the rnn
    Severity: Minor
    Found in research/lfads/synth_data/synthetic_data_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 generate_data has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def generate_data(rnn, T, E, x0s=None, P_sxn=None, input_magnitude=0.0,
    Severity: Major
    Found in research/lfads/synth_data/synthetic_data_utils.py - About 50 mins to fix

      Function generate_rnn has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def generate_rnn(rng, N, g, tau, dt, max_firing_rate):
      Severity: Minor
      Found in research/lfads/synth_data/synthetic_data_utils.py - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status