rusty1s/embedded_gcnn

View on GitHub

Showing 33 of 54 total issues

FormFeatureExtraction has 69 functions (exceeds 20 allowed). Consider refactoring.
Open

class FormFeatureExtraction(object):
    def __init__(self, segmentation):
        self.segmentation = segmentation

    def get_features(self, features=None):
Severity: Major
Found in lib/segmentation/form_feature_extraction.py - About 1 day to fix

    File form_feature_extraction.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    from __future__ import division
    
    import re
    
    from cached_property import cached_property
    Severity: Minor
    Found in lib/segmentation/form_feature_extraction.py - About 3 hrs to fix

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

      def normalized_cut(adj, rid=None):
          """Perform NormalizedCut on a given adjacency matrix. Return a cluster
          map indicating the resulting pairwise cluster."""
      
          if rid is None:
      Severity: Minor
      Found in lib/graph/clustering.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 test_feature_extraction has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def test_feature_extraction(self):
              segmentation = np.array([[0, 1, 1, 4, 6, 6], [0, 0, 1, 4, 6, 7],
                                       [0, 3, 1, 5, 5, 7], [0, 2, 2, 2, 5, 7],
                                       [8, 8, 2, 5, 5, 9], [8, 8, 8, 9, 9, 9]])
      
      
      Severity: Minor
      Found in lib/segmentation/form_feature_extraction_test.py - About 2 hrs to fix

        Function train has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        def train(model,
                  data,
                  preprocess_algorithm,
                  batch_size,
                  dropout,
        Severity: Minor
        Found in lib/model/train.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 test_coarsen_adj_with_efficient_pooling has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def test_coarsen_adj_with_efficient_pooling(self):
                adj = [[0, 1, 1, 0, 0], [1, 0, 0, 1, 0], [1, 0, 0, 1, 0],
                       [0, 1, 1, 0, 1], [0, 0, 0, 1, 0]]
                adj = sp.coo_matrix(adj)
                points = np.array([[1, 1], [3, 2], [3, 0], [4, 1], [8, 3]])
        Severity: Minor
        Found in lib/graph/coarsening_test.py - About 1 hr to fix

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

              def __init__(self, data_dir, dataset, preprocess_algorithm):
                  self._data_dir = data_dir
                  self.epochs_completed = 0
                  self._index_in_epoch = 0
          
          
          Severity: Minor
          Found in lib/pipeline/dataset.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 __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self,
                           dataset,
                           preprocess_algorithm,
                           augment,
                           batch_size,
          Severity: Minor
          Found in lib/datasets/queue.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 test_conv_K2_P4 has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def test_conv_K2_P4(self):
                  features = [[1, 2], [3, 4], [5, 6], [7, 8]]
                  features = tf.constant(features, dtype=tf.float32)
          
                  adj_dist = [[0, 2, 1, 0], [2, 0, 0, 1], [1, 0, 0, 2], [0, 1, 2, 0]]
          Severity: Minor
          Found in lib/layer/embedded_gcnn_test.py - About 1 hr to fix

            Function train has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def train(model,
            Severity: Major
            Found in lib/model/train.py - About 1 hr to fix

              Function test_coarsen_adj has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def test_coarsen_adj(self):
                      adj = [[0, 1, 1, 0, 0], [1, 0, 0, 1, 0], [1, 0, 0, 1, 0],
                             [0, 1, 1, 0, 1], [0, 0, 0, 1, 0]]
                      adj = sp.coo_matrix(adj)
                      points = np.array([[1, 1], [3, 2], [3, 0], [4, 1], [8, 3]])
              Severity: Minor
              Found in lib/graph/coarsening_test.py - About 1 hr to fix

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

                    def __init__(self,
                Severity: Major
                Found in lib/layer/var_layer.py - About 1 hr to fix

                  Function test_coarsen_clustered_adj has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def test_coarsen_clustered_adj(self):
                          adj = [[0, 1, 0, 1, 0], [1, 0, 1, 0, 0], [0, 1, 0, 1, 0],
                                 [1, 0, 1, 0, 1], [0, 0, 0, 1, 0]]
                          adj = sp.coo_matrix(adj)
                          points = np.array([[1, 1], [3, 1], [3, 3], [1, 3], [0, 8]])
                  Severity: Minor
                  Found in lib/graph/coarsening_test.py - About 1 hr to fix

                    Function coarsen_adj has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def coarsen_adj(adj,
                    Severity: Major
                    Found in lib/graph/coarsening.py - About 50 mins to fix

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

                          def __init__(self,
                      Severity: Major
                      Found in lib/model/model.py - About 50 mins to fix

                        Function _coarsen_adj has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def _coarsen_adj(adj,
                        Severity: Major
                        Found in lib/graph/coarsening.py - About 50 mins to fix

                          Function preprocess_spatial_fixed has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def preprocess_spatial_fixed(
                          Severity: Major
                          Found in mnist_spatial.py - About 50 mins to fix

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

                                def __init__(self,
                            Severity: Major
                            Found in lib/layer/embedded_gcnn.py - About 50 mins to fix

                              Function preprocess_pipeline has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def preprocess_pipeline(image,
                              Severity: Major
                              Found in lib/pipeline/preprocess.py - About 50 mins to fix

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

                                    def __init__(self,
                                Severity: Major
                                Found in lib/datasets/queue.py - About 50 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language