tensorflow/tensorflow

View on GitHub
tensorflow/python/feature_column/feature_column_v2.py

Summary

Maintainability
F
1 mo
Test Coverage

File feature_column_v2.py has 3500 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 The TensorFlow Authors. 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: Major
Found in tensorflow/python/feature_column/feature_column_v2.py - About 1 wk to fix

    Function categorical_column_with_vocabulary_file_v2 has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def categorical_column_with_vocabulary_file_v2(key,
                                                   vocabulary_file,
                                                   vocabulary_size=None,
                                                   dtype=dtypes.string,
                                                   default_value=None,
    Severity: Minor
    Found in tensorflow/python/feature_column/feature_column_v2.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 shared_embedding_columns_v2 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def shared_embedding_columns_v2(categorical_columns,
                                    dimension,
                                    combiner='mean',
                                    initializer=None,
                                    shared_embedding_collection_name=None,
    Severity: Minor
    Found in tensorflow/python/feature_column/feature_column_v2.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 shared_embedding_columns has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def shared_embedding_columns(categorical_columns,
                                 dimension,
                                 combiner='mean',
                                 initializer=None,
                                 shared_embedding_collection_name=None,
    Severity: Minor
    Found in tensorflow/python/feature_column/feature_column_v2.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 shared_embedding_columns_v2 has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def shared_embedding_columns_v2(categorical_columns,
    Severity: Major
    Found in tensorflow/python/feature_column/feature_column_v2.py - About 1 hr to fix

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

      def shared_embedding_columns(categorical_columns,
      Severity: Major
      Found in tensorflow/python/feature_column/feature_column_v2.py - About 1 hr to fix

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

        def embedding_column(categorical_column,
        Severity: Major
        Found in tensorflow/python/feature_column/feature_column_v2.py - About 1 hr to fix

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

            def __new__(cls,
          Severity: Major
          Found in tensorflow/python/feature_column/feature_column_v2.py - About 1 hr to fix

            Function _normalize_feature_columns has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            def _normalize_feature_columns(feature_columns):
              """Normalizes the `feature_columns` input.
            
              This method converts the `feature_columns` to list type as best as it can. In
              addition, verifies the type and other parts of feature_columns, required by
            Severity: Minor
            Found in tensorflow/python/feature_column/feature_column_v2.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 categorical_column_with_vocabulary_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            def categorical_column_with_vocabulary_list(key,
                                                        vocabulary_list,
                                                        dtype=None,
                                                        default_value=-1,
                                                        num_oov_buckets=0):
            Severity: Minor
            Found in tensorflow/python/feature_column/feature_column_v2.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 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def __init__(self,
            Severity: Major
            Found in tensorflow/python/feature_column/feature_column_v2.py - About 1 hr to fix

              Function make_parse_example_spec_v2 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def make_parse_example_spec_v2(feature_columns):
                """Creates parsing spec dictionary from input feature_columns.
              
                The returned dictionary can be used as arg 'features' in
                `tf.io.parse_example`.
              Severity: Minor
              Found in tensorflow/python/feature_column/feature_column_v2.py - About 55 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 categorical_column_with_vocabulary_file_v2 has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def categorical_column_with_vocabulary_file_v2(key,
              Severity: Major
              Found in tensorflow/python/feature_column/feature_column_v2.py - About 50 mins to fix

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

                  def create_variable(self,
                Severity: Major
                Found in tensorflow/python/feature_column/feature_column_v2.py - About 50 mins to fix

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

                    def create_variable(self,
                  Severity: Major
                  Found in tensorflow/python/feature_column/feature_column_v2.py - About 50 mins to fix

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

                      def __new__(cls,
                    Severity: Major
                    Found in tensorflow/python/feature_column/feature_column_v2.py - About 50 mins to fix

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

                      def categorical_column_with_vocabulary_file(key,
                      Severity: Minor
                      Found in tensorflow/python/feature_column/feature_column_v2.py - About 45 mins to fix

                        Function bucketized_column has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def bucketized_column(source_column, boundaries):
                          """Represents discretized dense input bucketed by `boundaries`.
                        
                          Buckets include the left boundary, and exclude the right boundary. Namely,
                          `boundaries=[0., 1., 2.]` generates buckets `(-inf, 0.)`, `[0., 1.)`,
                        Severity: Minor
                        Found in tensorflow/python/feature_column/feature_column_v2.py - About 45 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 _get_raw_feature_as_tensor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def _get_raw_feature_as_tensor(self, key):
                            """Gets the raw_feature (keyed by `key`) as `tensor`.
                        
                            The raw feature is converted to (sparse) tensor and maybe expand dim.
                        
                        
                        Severity: Minor
                        Found in tensorflow/python/feature_column/feature_column_v2.py - About 45 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 _transform_feature has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def _transform_feature(self, inputs):
                            """Generates a hashed sparse cross from the input tensors."""
                            feature_tensors = []
                            for key in _collect_leaf_level_keys(self):
                              if isinstance(key, six.string_types):
                        Severity: Minor
                        Found in tensorflow/python/feature_column/feature_column_v2.py - About 45 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 _make_table has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def _make_table(self, key_dtype, state_manager):
                            name = '{}_lookup'.format(self.key)
                            if state_manager is None or not state_manager.has_resource(self, name):
                              with ops.init_scope():
                                if self.file_format == 'tfrecord_gzip':
                        Severity: Minor
                        Found in tensorflow/python/feature_column/feature_column_v2.py - About 45 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 crossed_column has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def crossed_column(keys, hash_bucket_size, hash_key=None):
                          """Returns a column for performing crosses of categorical features.
                        
                          Crossed features will be hashed according to `hash_bucket_size`. Conceptually,
                          the transformation can be thought of as:
                        Severity: Minor
                        Found in tensorflow/python/feature_column/feature_column_v2.py - About 45 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 transform_feature has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def transform_feature(self, transformation_cache, state_manager):
                            """Generates a hashed sparse cross from the input tensors."""
                            feature_tensors = []
                            for key in _collect_leaf_level_keys(self):
                              if isinstance(key, six.string_types):
                        Severity: Minor
                        Found in tensorflow/python/feature_column/feature_column_v2.py - About 45 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 _create_weighted_sum has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def _create_weighted_sum(column, transformation_cache, state_manager,
                        Severity: Minor
                        Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 mins to fix

                          Function categorical_column_with_vocabulary_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def categorical_column_with_vocabulary_list(key,
                          Severity: Minor
                          Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 mins to fix

                            Function numeric_column has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def numeric_column(key,
                            Severity: Minor
                            Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 mins to fix

                              Function _create_categorical_column_weighted_sum has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def _create_categorical_column_weighted_sum(column, transformation_cache,
                              Severity: Minor
                              Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 mins to fix

                                Function __new__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  def __new__(cls,
                                Severity: Minor
                                Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 mins to fix

                                  Function create_variable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def create_variable(self,
                                                        feature_column,
                                                        name,
                                                        shape,
                                                        dtype=None,
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 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 _is_v2_column has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def _is_v2_column(self):
                                      for key in _collect_leaf_level_keys(self):
                                        if isinstance(key, six.string_types):
                                          continue
                                        if not isinstance(key, fc_types.FeatureColumn):
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 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 _verify_static_batch_size_equality has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _verify_static_batch_size_equality(tensors, columns):
                                    """Verify equality between static batch sizes.
                                  
                                    Args:
                                      tensors: iterable of input tensors.
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py - About 35 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 _transform_input_tensor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def _transform_input_tensor(self, input_tensor, state_manager=None):
                                      """Creates a lookup table for the vocabulary list."""
                                      if self.dtype.is_integer != input_tensor.dtype.is_integer:
                                        raise ValueError(
                                            'Column dtype and SparseTensors dtype must be compatible. '
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.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 embedding_column has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def embedding_column(categorical_column,
                                                       dimension,
                                                       combiner='mean',
                                                       initializer=None,
                                                       ckpt_to_load_from=None,
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.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 embedding_weights has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def embedding_weights(self):
                                      key = ops.get_default_graph()._graph_key  # pylint: disable=protected-access
                                      if key not in self._embedding_weights:
                                        embedding_shape = (self._num_buckets, self._dimension)
                                        var = variable_scope.get_variable(
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.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 _to_sparse_input_and_drop_ignore_values has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _to_sparse_input_and_drop_ignore_values(input_tensor, ignore_value=None):
                                    """Converts a `Tensor` to a `SparseTensor`, dropping ignore_value cells.
                                  
                                    If `input_tensor` is already a `SparseTensor`, just return it.
                                  
                                  
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def get(self, key, state_manager, training=None):
                                      """Returns a `Tensor` for the given key.
                                  
                                      A `str` key is used to access a base feature (not-transformed). When a
                                      `FeatureColumn` is passed, the transformed feature is returned if it
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.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 _check_shape has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _check_shape(shape, key):
                                    """Returns shape if it's valid, raises error otherwise."""
                                    assert shape is not None
                                    if not nest.is_nested(shape):
                                      shape = [shape]
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.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

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  @doc_controls.header(_FEATURE_COLUMN_DEPRECATION_WARNING)
                                  @tf_export('feature_column.categorical_column_with_vocabulary_list')
                                  @deprecation.deprecated(None, _FEATURE_COLUMN_DEPRECATION_RUNTIME_WARNING)
                                  def categorical_column_with_vocabulary_list(key,
                                                                              vocabulary_list,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 days to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 1162..1272

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 266.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def _get_raw_feature_as_tensor(self, key):
                                      """Gets the raw_feature (keyed by `key`) as `tensor`.
                                  
                                      The raw feature is converted to (sparse) tensor and maybe expand dim.
                                  
                                  
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 days to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2082..2129

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 222.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  def _to_sparse_input_and_drop_ignore_values(input_tensor, ignore_value=None):
                                    """Converts a `Tensor` to a `SparseTensor`, dropping ignore_value cells.
                                  
                                    If `input_tensor` is already a `SparseTensor`, just return it.
                                  
                                  
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 day to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2146..2190

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 190.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  @doc_controls.header(_FEATURE_COLUMN_DEPRECATION_WARNING)
                                  @tf_export('feature_column.numeric_column')
                                  @deprecation.deprecated(None, _FEATURE_COLUMN_DEPRECATION_RUNTIME_WARNING)
                                  def numeric_column(key,
                                                     shape=(1,),
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 day to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 828..895

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 124.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def get_sequence_dense_tensor(self, transformation_cache, state_manager):
                                      """See `SequenceDenseColumn` base class."""
                                      if not isinstance(self.categorical_column, SequenceCategoricalColumn):
                                        raise ValueError(
                                            'In embedding_column: {}. '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 6 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3951..3968

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 104.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def get_sequence_dense_tensor(self, transformation_cache, state_manager):
                                      """See `SequenceDenseColumn` base class."""
                                      if not isinstance(self.categorical_column, SequenceCategoricalColumn):
                                        raise ValueError(
                                            'In indicator_column: {}. '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 6 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2927..2943

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 104.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  @doc_controls.header(_FEATURE_COLUMN_DEPRECATION_WARNING)
                                  @tf_export('feature_column.categorical_column_with_identity')
                                  @deprecation.deprecated(None, _FEATURE_COLUMN_DEPRECATION_RUNTIME_WARNING)
                                  def categorical_column_with_identity(key, num_buckets, default_value=None):
                                    """A `CategoricalColumn` that returns identity values.
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 6 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 1278..1341

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 99.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  @doc_controls.header(_FEATURE_COLUMN_DEPRECATION_WARNING)
                                  @tf_export('feature_column.categorical_column_with_hash_bucket')
                                  @deprecation.deprecated(None, _FEATURE_COLUMN_DEPRECATION_RUNTIME_WARNING)
                                  def categorical_column_with_hash_bucket(key,
                                                                          hash_bucket_size,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 5 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 985..1040

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 88.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    @property
                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _parse_example_spec(self):
                                      config = self.categorical_column._parse_example_spec  # pylint: disable=protected-access
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2882..2889

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 70.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    @classmethod
                                    def from_config(cls, config, custom_objects=None, columns_by_name=None):
                                      """See 'FeatureColumn` base class."""
                                      from tensorflow.python.feature_column.serialization import deserialize_feature_column  # pylint: disable=g-import-not-at-top
                                      _check_config_keys(config, cls._fields)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2478..2486
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4013..4021

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 69.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    @classmethod
                                    def from_config(cls, config, custom_objects=None, columns_by_name=None):
                                      """See 'FeatureColumn` base class."""
                                      from tensorflow.python.feature_column.serialization import deserialize_feature_column  # pylint: disable=g-import-not-at-top
                                      _check_config_keys(config, cls._fields)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4013..4021
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4164..4172

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 69.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    @classmethod
                                    def from_config(cls, config, custom_objects=None, columns_by_name=None):
                                      """See 'FeatureColumn` base class."""
                                      from tensorflow.python.feature_column.serialization import deserialize_feature_column  # pylint: disable=g-import-not-at-top
                                      _check_config_keys(config, cls._fields)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2478..2486
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4164..4172

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 69.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                        values = array_ops.where_v2(
                                            math_ops.logical_or(
                                                values < zero, values >= num_buckets, name='out_of_range'),
                                            array_ops.fill(
                                                dims=array_ops.shape(values),
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2846..2852

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 67.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    @classmethod
                                    def from_config(cls, config, custom_objects=None, columns_by_name=None):
                                      """See 'FeatureColumn` base class."""
                                      _check_config_keys(config, cls._fields)
                                      kwargs = _standardize_and_copy_config(config)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3239..3245
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3361..3367

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 66.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    @classmethod
                                    def from_config(cls, config, custom_objects=None, columns_by_name=None):
                                      """See 'FeatureColumn` base class."""
                                      _check_config_keys(config, cls._fields)
                                      kwargs = _standardize_and_copy_config(config)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3077..3083
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3361..3367

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 66.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    @classmethod
                                    def from_config(cls, config, custom_objects=None, columns_by_name=None):
                                      """See 'FeatureColumn` base class."""
                                      _check_config_keys(config, cls._fields)
                                      kwargs = _standardize_and_copy_config(config)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3077..3083
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3239..3245

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 66.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      for key, value in six.iteritems(config):
                                        if key in result and value != result[key]:
                                          raise ValueError('feature_columns contain different parse_spec for key '
                                                           '{}. Given {} and {}'.format(key, value, result[key]))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 3 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 725..728

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 63.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  @doc_controls.header(_FEATURE_COLUMN_DEPRECATION_WARNING)
                                  @tf_export('feature_column.weighted_categorical_column')
                                  @deprecation.deprecated(None, _FEATURE_COLUMN_DEPRECATION_RUNTIME_WARNING)
                                  def weighted_categorical_column(categorical_column,
                                                                  weight_feature_key,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 1379..1448

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 60.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def __new__(cls,
                                                categorical_column,
                                                dimension,
                                                combiner,
                                                initializer,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2372..2382

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 59.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def get_dense_tensor(self, transformation_cache, state_manager):
                                      """Returns dense `Tensor` representing feature.
                                  
                                      Args:
                                        transformation_cache: A `FeatureTransformationCache` object to access
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2910..2922

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 57.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def get_dense_tensor(self, transformation_cache, state_manager):
                                      """Returns the embedding lookup result."""
                                      if isinstance(self.categorical_column, SequenceCategoricalColumn):
                                        raise ValueError(
                                            'In embedding_column: {}. '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3901..3928

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 57.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                  def _collect_leaf_level_keys(cross):
                                    """Collects base keys by expanding all nested crosses.
                                  
                                    Args:
                                      cross: A `CrossedColumn`.
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2980..2995

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 57.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    for i in range(len(boundaries) - 1):
                                      if boundaries[i] >= boundaries[i + 1]:
                                        raise ValueError('boundaries must be a sorted list.')
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 979..981

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 55.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                        if self._ckpt_to_load_from is not None:
                                          to_restore = var
                                          if isinstance(to_restore, variables.PartitionedVariable):
                                            to_restore = to_restore._get_variable_list()  # pylint: disable=protected-access
                                          checkpoint_utils.init_from_checkpoint(
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2430..2435
                                  tensorflow/python/feature_column/feature_column.py on lines 2581..2586
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2589..2594

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 55.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                      if self.ckpt_to_load_from is not None:
                                        to_restore = embedding_weights
                                        if isinstance(to_restore, variables.PartitionedVariable):
                                          to_restore = to_restore._get_variable_list()  # pylint: disable=protected-access
                                        checkpoint_utils.init_from_checkpoint(
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2430..2435
                                  tensorflow/python/feature_column/feature_column.py on lines 2581..2586
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2806..2811

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 55.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    for column in feature_columns:
                                      if column.name in name_to_column:
                                        raise ValueError('Duplicate feature column name found for columns: {} '
                                                         'and {}. This usually means that these columns refer to '
                                                         'same base feature. Either one must be discarded or a '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2225..2233

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 53.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    if num_oov_buckets:
                                      if default_value is not None:
                                        raise ValueError(
                                            'Can\'t specify both num_oov_buckets and default_value in {}.'.format(
                                                key))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 1143..1150

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 51.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                        elif isinstance(key, (CategoricalColumn, fc_old._CategoricalColumn)):  # pylint: disable=protected-access
                                          ids_and_weights = key._get_sparse_tensors(inputs)  # pylint: disable=protected-access
                                          if ids_and_weights.weight_tensor is not None:
                                            raise ValueError(
                                                'crossed_column does not support weight_tensor, but the given '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 2 hrs to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2953..2960

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 50.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    def get_config(self):
                                      """See 'FeatureColumn` base class."""
                                      from tensorflow.python.feature_column.serialization import serialize_feature_column  # pylint: disable=g-import-not-at-top
                                      config = dict(zip(self._fields, self))
                                      config['source_column'] = serialize_feature_column(self.source_column)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4005..4011
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4156..4162

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 48.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    def get_config(self):
                                      """See 'FeatureColumn` base class."""
                                      from tensorflow.python.feature_column.serialization import serialize_feature_column  # pylint: disable=g-import-not-at-top
                                      config = dict(zip(self._fields, self))
                                      config['categorical_column'] = serialize_feature_column(
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2471..2476
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4005..4011

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 48.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                    def get_config(self):
                                      """See 'FeatureColumn` base class."""
                                      from tensorflow.python.feature_column.serialization import serialize_feature_column  # pylint: disable=g-import-not-at-top
                                      config = dict(zip(self._fields, self))
                                      config['categorical_column'] = serialize_feature_column(
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 2 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2471..2476
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 4156..4162

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 48.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if not isinstance(
                                          self.categorical_column,
                                          (SequenceCategoricalColumn, fc_old._SequenceCategoricalColumn)):  # pylint: disable=protected-access
                                        raise ValueError(
                                            'In embedding_column: {}. '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3981..3990

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 45.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if not isinstance(
                                          self.categorical_column,
                                          (SequenceCategoricalColumn, fc_old._SequenceCategoricalColumn)):  # pylint: disable=protected-access
                                        raise ValueError(
                                            'In indicator_column: {}. '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2710..2719

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 45.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    def get_config(self):
                                      """See 'FeatureColumn` base class."""
                                      config = dict(zip(self._fields, self))
                                      config['dtype'] = self.dtype.name
                                      return config
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3233..3237
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3355..3359
                                  tensorflow/python/feature_column/sequence_feature_column.py on lines 494..498

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 43.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    def get_config(self):
                                      """See 'FeatureColumn` base class."""
                                      config = dict(zip(self._fields, self))
                                      config['dtype'] = self.dtype.name
                                      return config
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3071..3075
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3233..3237
                                  tensorflow/python/feature_column/sequence_feature_column.py on lines 494..498

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 43.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _get_sparse_tensors(self,
                                                            inputs,
                                                            weight_collections=None,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3056..3064
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3340..3348
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3453..3461

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 43.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    def get_config(self):
                                      """See 'FeatureColumn` base class."""
                                      config = dict(zip(self._fields, self))
                                      config['dtype'] = self.dtype.name
                                      return config
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3071..3075
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3355..3359
                                  tensorflow/python/feature_column/sequence_feature_column.py on lines 494..498

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 43.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _get_sparse_tensors(self,
                                                            inputs,
                                                            weight_collections=None,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3056..3064
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3218..3226
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3340..3348

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 43.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _get_sparse_tensors(self,
                                                            inputs,
                                                            weight_collections=None,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3218..3226
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3340..3348
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3453..3461

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 43.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _get_sparse_tensors(self,
                                                            inputs,
                                                            weight_collections=None,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3056..3064
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3218..3226
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3453..3461

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 43.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _transform_feature(self, inputs):
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(inputs.get(self.key))
                                      return self._transform_input_tensor(input_tensor)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3034..3038
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3196..3200
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3431..3435

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 42.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _transform_feature(self, inputs):
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(inputs.get(self.key))
                                      return self._transform_input_tensor(input_tensor)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3034..3038
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3318..3322
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3431..3435

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 42.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _transform_feature(self, inputs):
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(inputs.get(self.key))
                                      return self._transform_input_tensor(input_tensor)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3196..3200
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3318..3322
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3431..3435

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 42.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _transform_feature(self, inputs):
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(inputs.get(self.key))
                                      return self._transform_input_tensor(input_tensor)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3034..3038
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3196..3200
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3318..3322

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 42.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if not isinstance(c, type(c0)):
                                        raise ValueError(
                                            'To use shared_embedding_column, all categorical_columns must have '
                                            'the same type, or be weighted_categorical_column or sequence column '
                                            'of the same type. Given column: {} of type: {} does not match given '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 786..791

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 41.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if not isinstance(c, type(c0)):
                                        raise ValueError(
                                            'To use shared_embedding_column, all categorical_columns must have '
                                            'the same type, or be weighted_categorical_column or sequence column '
                                            'of the same type. Given column: {} of type: {} does not match given '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 640..645

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 41.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def _get_dense_tensor_for_input_tensor(self, input_tensor):
                                      return array_ops.one_hot(
                                          indices=math_ops.cast(input_tensor, dtypes.int64),
                                          depth=len(self.boundaries) + 1,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2322..2324

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 41.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if isinstance(
                                          self.categorical_column,
                                          (SequenceCategoricalColumn, fc_old._SequenceCategoricalColumn)):  # pylint: disable=protected-access
                                        raise ValueError(
                                            'In indicator_column: {}. '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2668..2679

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 41.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if isinstance(
                                          self.categorical_column,
                                          (SequenceCategoricalColumn, fc_old._SequenceCategoricalColumn)):  # pylint: disable=protected-access
                                        raise ValueError(
                                            'In embedding_column: {}. '
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3935..3946

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 41.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    @deprecation.deprecated(_FEATURE_COLUMN_DEPRECATION_DATE,
                                                            _FEATURE_COLUMN_DEPRECATION)
                                    def _get_sparse_tensors(self,
                                                            inputs,
                                                            weight_collections=None,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2912..2919

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 40.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 6 locations. Consider refactoring.
                                  Open

                                      if self.dtype.is_integer != input_tensor.dtype.is_integer:
                                        raise ValueError(
                                            'Column dtype and SparseTensors dtype must be compatible. '
                                            'key: {}, column dtype: {}, tensor dtype: {}'.format(
                                                self.key, self.dtype, input_tensor.dtype))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 5 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2681..2685
                                  tensorflow/python/feature_column/feature_column.py on lines 2728..2732
                                  tensorflow/python/feature_column/feature_column.py on lines 2783..2787
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3011..3015
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3280..3284

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 39.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 6 locations. Consider refactoring.
                                  Open

                                      if self.dtype.is_integer != input_tensor.dtype.is_integer:
                                        raise ValueError(
                                            'Column dtype and SparseTensors dtype must be compatible. '
                                            'key: {}, column dtype: {}, tensor dtype: {}'.format(
                                                self.key, self.dtype, input_tensor.dtype))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 5 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2681..2685
                                  tensorflow/python/feature_column/feature_column.py on lines 2728..2732
                                  tensorflow/python/feature_column/feature_column.py on lines 2783..2787
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3011..3015
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3173..3177

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 39.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 6 locations. Consider refactoring.
                                  Open

                                      if self.dtype.is_integer != input_tensor.dtype.is_integer:
                                        raise ValueError(
                                            'Column dtype and SparseTensors dtype must be compatible. '
                                            'key: {}, column dtype: {}, tensor dtype: {}'.format(
                                                self.key, self.dtype, input_tensor.dtype))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 5 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2681..2685
                                  tensorflow/python/feature_column/feature_column.py on lines 2728..2732
                                  tensorflow/python/feature_column/feature_column.py on lines 2783..2787
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3173..3177
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3280..3284

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 39.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      embedding_weights = variable_scope.get_variable(
                                          name='embedding_weights',
                                          shape=embedding_shape,
                                          dtype=dtypes.float32,
                                          initializer=self.initializer,
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2572..2577

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 39.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if key in self._features:
                                        feature_tensor = self._get_raw_feature_as_tensor(key)
                                        self._feature_tensors[key] = feature_tensor
                                        return feature_tensor
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2062..2065

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 39.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def transform_feature(self, transformation_cache, state_manager):
                                      """Creates a lookup table for the vocabulary list."""
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(
                                          transformation_cache.get(self.key, state_manager))
                                      return self._transform_input_tensor(input_tensor, state_manager)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3190..3194

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 39.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def transform_feature(self, transformation_cache, state_manager):
                                      """Creates a lookup table for the vocabulary."""
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(
                                          transformation_cache.get(self.key, state_manager))
                                      return self._transform_input_tensor(input_tensor, state_manager)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3312..3316

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 39.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      bucket_indices = (
                                          array_ops.reshape(input_tensor,
                                                            (-1,)) + (len(self.boundaries) + 1) * i2)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2350..2352

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    if initializer is None:
                                      initializer = init_ops.truncated_normal_initializer(
                                          mean=0.0, stddev=1. / math.sqrt(dimension))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 801..803
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 502..504
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 767..769

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    if initializer is None:
                                      initializer = init_ops.truncated_normal_initializer(
                                          mean=0.0, stddev=1 / math.sqrt(dimension))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 801..803
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 609..611
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 767..769

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    if (initializer is not None) and (not callable(initializer)):
                                      raise ValueError('initializer must be callable if specified. '
                                                       'Embedding of column_name: {}'.format(
                                                           categorical_column.name))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 797..800

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      i1 = array_ops.reshape(
                                          array_ops.tile(
                                              array_ops.expand_dims(math_ops.range(0, batch_size), 1),
                                              [1, source_dimension]), (-1,))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2343..2346

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    if initializer is None:
                                      initializer = init_ops.truncated_normal_initializer(
                                          mean=0.0, stddev=1. / math.sqrt(dimension))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 801..803
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 502..504
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 609..611

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def transform_feature(self, transformation_cache, state_manager):
                                      """Hashes the values in the feature_column."""
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(
                                          transformation_cache.get(self.key, state_manager))
                                      return self._transform_input_tensor(input_tensor)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3425..3429

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def transform_feature(self, transformation_cache, state_manager):
                                      """Returns a SparseTensor with identity values."""
                                      input_tensor = _to_sparse_input_and_drop_ignore_values(
                                          transformation_cache.get(self.key, state_manager))
                                      return self._transform_input_tensor(input_tensor)
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 1 hr to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 3028..3032

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 38.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    if weight_tensor is not None:
                                      weight_tensor = sparse_ops.sparse_reshape(
                                          weight_tensor, [array_ops.shape(weight_tensor)[0], -1])
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 55 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 1961..1963

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 37.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      return tensor_shape.TensorShape(
                                          tuple(self.source_column.shape) + (len(self.boundaries) + 1,))
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 55 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2313..2316

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 37.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    if not shared_embedding_collection_name:
                                      shared_embedding_collection_name = '_'.join(c.name for c in sorted_columns)
                                      shared_embedding_collection_name += '_shared_embedding'
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 50 mins to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 799..801

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 36.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    if not keys or len(keys) < 2:
                                      raise ValueError(
                                          'keys must be a list with length > 1. Given: {}'.format(keys))
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 50 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 1561..1563

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 36.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    if not shared_embedding_collection_name:
                                      shared_embedding_collection_name = '_'.join(c.name for c in sorted_columns)
                                      shared_embedding_collection_name += '_shared_embedding'
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 50 mins to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 653..655

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 36.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                      if (not self.use_safe_embedding_lookup and sparse_id_rank is not None and
                                          sparse_id_rank <= 2):
                                        embedding_lookup_sparse = embedding_ops.embedding_lookup_sparse_v2
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 45 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2440..2442
                                  tensorflow/python/feature_column/feature_column.py on lines 2591..2593
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2898..2900

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 35.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                        if (not self.use_safe_embedding_lookup and sparse_id_rank is not None and
                                            sparse_id_rank <= 2):
                                          embedding_lookup_sparse = embedding_ops.embedding_lookup_sparse_v2
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 45 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2440..2442
                                  tensorflow/python/feature_column/feature_column.py on lines 2591..2593
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2599..2601

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 35.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if self.dtype == dtypes.string:
                                        sparse_values = input_tensor.values
                                      else:
                                        sparse_values = string_ops.as_string(input_tensor.values)
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 45 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2687..2690

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 35.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if name in self._cols_to_vars_map[feature_column]:
                                        return self._cols_to_vars_map[feature_column][name]
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 45 mins to fix
                                  tensorflow/python/feature_column/feature_column_v2_test.py on lines 4668..4669

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 35.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    if (dimension is None) or (dimension < 1):
                                      raise ValueError('Invalid dimension {}.'.format(dimension))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 40 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 791..792
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 601..602
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 759..760

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 34.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    if (dimension is None) or (dimension < 1):
                                      raise ValueError('Invalid dimension {}.'.format(dimension))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 40 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 791..792
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 492..493
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 759..760

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 34.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 4 locations. Consider refactoring.
                                  Open

                                    if (dimension is None) or (dimension < 1):
                                      raise ValueError('Invalid dimension {}.'.format(dimension))
                                  Severity: Major
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 3 other locations - About 40 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 791..792
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 492..493
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 601..602

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 34.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if input_tensor.values.dtype != dtypes.int64:
                                        values = math_ops.cast(values, dtypes.int64, name='values')
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 40 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2839..2840

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 34.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if self.dtype != weight_tensor.dtype.base_dtype:
                                        raise ValueError('Bad dtype, expected {}, but got {}.'.format(
                                            self.dtype, weight_tensor.dtype))
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 40 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 2901..2903

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 34.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      target_shape = [shape[0], shape[1], math_ops.reduce_prod(shape[2:])]
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 35 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 3188..3188

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 33.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    return EmbeddingColumn(
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 35 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 816..816

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 33.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    for column in feature_columns:
                                      if not isinstance(column, fc_types.FeatureColumn):
                                        raise ValueError('Items of feature_columns must be a FeatureColumn. '
                                                         'Given (type {}): {}.'.format(type(column), column))
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 35 mins to fix
                                  tensorflow/python/feature_column/utils.py on lines 57..61

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 33.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    if not hash_bucket_size or hash_bucket_size < 1:
                                      raise ValueError('hash_bucket_size must be > 1. '
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 30 mins to fix
                                  tensorflow/python/feature_column/feature_column.py on lines 1558..1559

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 32.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def get_sparse_tensors(self, transformation_cache, state_manager):
                                      """Converts dense inputs to SparseTensor so downstream code can use it."""
                                      input_tensor = transformation_cache.get(self, state_manager)
                                      return self._get_sparse_tensors_for_input_tensor(input_tensor)
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 30 mins to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2400..2403

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 32.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                    def get_dense_tensor(self, transformation_cache, state_manager):
                                      """Returns one hot encoded dense `Tensor`."""
                                      input_tensor = transformation_cache.get(self, state_manager)
                                      return self._get_dense_tensor_for_input_tensor(input_tensor)
                                  Severity: Minor
                                  Found in tensorflow/python/feature_column/feature_column_v2.py and 1 other location - About 30 mins to fix
                                  tensorflow/python/feature_column/feature_column_v2.py on lines 2449..2452

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 32.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  There are no issues that match your filters.

                                  Category
                                  Status