tensorflow/tensorflow

View on GitHub
tensorflow/lite/python/lite_v2_test_util.py

Summary

Maintainability
A
1 hr
Test Coverage

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

  def _createV2QATLowBitKerasModel(self, shape, weight_only, num_bits, bit_min,
Severity: Minor
Found in tensorflow/lite/python/lite_v2_test_util.py - About 45 mins to fix

    Function _createReadAssignModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def _createReadAssignModel(self, number_of_states=2):
        dtype = float
    
        class ReadAssign(tf.keras.layers.Layer):
          """ReadAssign model for the variable quantization test."""
    Severity: Minor
    Found in tensorflow/lite/python/lite_v2_test_util.py - About 25 mins 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 _getMultiFunctionModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def _getMultiFunctionModel(self):
    
        class BasicModel(autotrackable.AutoTrackable):
          """Basic model with multiple functions."""
    
    
    Severity: Minor
    Found in tensorflow/lite/python/lite_v2_test_util.py - About 25 mins 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

    There are no issues that match your filters.

    Category
    Status