tensorflow/tensorflow

View on GitHub
tensorflow/python/training/warm_starting_util_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File warm_starting_util_test.py has 978 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/training/warm_starting_util_test.py - About 2 days to fix

    WarmStartingUtilTest has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class WarmStartingUtilTest(test.TestCase):
    
      def _write_vocab(self, string_values, file_name):
        vocab_file = os.path.join(self.get_temp_dir(), file_name)
        with open(vocab_file, "w") as f:
    Severity: Minor
    Found in tensorflow/python/training/warm_starting_util_test.py - About 5 hrs to fix

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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_output_layer = variable_scope.get_variable(
                  "fruit_output_layer",
                  shape=[4, 3],
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 day to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 359..379

      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 214.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_output_layer = variable_scope.get_variable(
                  "fruit_output_layer",
                  shape=[4, 3],
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 day to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 425..445

      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 214.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_output_layer = variable_scope.get_variable(
                  "fruit_output_layer",
                  initializer=[[0., 0., 0.], [0., 0., 0.], [0., 0., 0.],
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 day to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 301..314

      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 141.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_output_layer = variable_scope.get_variable(
                  "fruit_output_layer",
                  initializer=[[0., 0., 0.], [0., 0., 0.], [0., 0., 0.],
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 day to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 225..238

      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 141.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_weights = variable_scope.get_variable(
                  "fruit_weights", initializer=[[0.], [0.], [0.], [0.], [0.]])
              ws_util._warm_start_var_with_vocab(fruit_weights, new_vocab_path, 5,
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 205..213

      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 121.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_weights = variable_scope.get_variable(
                  "fruit_weights", initializer=[[0.], [0.], [0.], [0.], [0.]])
              ws_util._warm_start_var_with_vocab(fruit_weights, new_vocab_path, 5,
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 279..287

      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 121.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              variable_scope.get_variable(
                  "linear_model/sc_hash/weights", shape=[15, 1], initializer=norms())
              sc_keys_weights = variable_scope.get_variable(
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 950..960

      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 118.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              variable_scope.get_variable(
                  "linear_model/sc_hash/weights", shape=[15, 1], initializer=norms())
              sc_keys_weights = variable_scope.get_variable(
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 882..892

      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 118.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_weights = variable_scope.get_variable(
                  "fruit_weights", initializer=[[0.], [0.], [0.], [0.]])
              prev_tensor_name, var = ws_util._get_var_info(fruit_weights)
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 136..144

      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 117.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              fruit_weights = variable_scope.get_variable(
                  "fruit_weights", initializer=[[0.], [0.], [0.], [0.]])
              prev_tensor_name, var = ws_util._get_var_info(fruit_weights)
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 118..126

      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 117.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_int], partitioner)
              ws_util.warm_start(self.get_temp_dir(), vars_to_warm_start=".*sc_int.*")
              self.evaluate(variables.global_variables_initializer())
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 5 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 605..613
      tensorflow/python/training/warm_starting_util_test.py on lines 639..649
      tensorflow/python/training/warm_starting_util_test.py on lines 763..771

      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 89.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_vocab], partitioner)
              # Since old vocab is not explicitly set in WarmStartSettings, the old
              # vocab is assumed to be same as new vocab.
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 5 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 576..582
      tensorflow/python/training/warm_starting_util_test.py on lines 605..613
      tensorflow/python/training/warm_starting_util_test.py on lines 763..771

      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 89.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_hash], partitioner)
              ws_util.warm_start(
                  self.get_temp_dir(), vars_to_warm_start=".*sc_hash.*")
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 5 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 576..582
      tensorflow/python/training/warm_starting_util_test.py on lines 639..649
      tensorflow/python/training/warm_starting_util_test.py on lines 763..771

      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 89.

      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

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([real_bucket], partitioner)
              ws_util.warm_start(
                  self.get_temp_dir(), vars_to_warm_start=".*real_bucketized.*")
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 5 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 576..582
      tensorflow/python/training/warm_starting_util_test.py on lines 605..613
      tensorflow/python/training/warm_starting_util_test.py on lines 639..649

      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 89.

      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 6 locations. Consider refactoring.
      Open

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_hash], partitioner)
              self.evaluate(variables.global_variables_initializer())
              # Without warm-starting, the weights should be initialized using default
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 5 other locations - About 4 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 566..573
      tensorflow/python/training/warm_starting_util_test.py on lines 629..636
      tensorflow/python/training/warm_starting_util_test.py on lines 665..672
      tensorflow/python/training/warm_starting_util_test.py on lines 710..717
      tensorflow/python/training/warm_starting_util_test.py on lines 753..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 81.

      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 6 locations. Consider refactoring.
      Open

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_vocab], partitioner)
              self.evaluate(variables.global_variables_initializer())
              # Without warm-starting, the weights should be initialized using default
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 5 other locations - About 4 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 566..573
      tensorflow/python/training/warm_starting_util_test.py on lines 595..602
      tensorflow/python/training/warm_starting_util_test.py on lines 629..636
      tensorflow/python/training/warm_starting_util_test.py on lines 710..717
      tensorflow/python/training/warm_starting_util_test.py on lines 753..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 81.

      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 6 locations. Consider refactoring.
      Open

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_int], partitioner)
              self.evaluate(variables.global_variables_initializer())
              # Without warm-starting, the weights should be initialized using default
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 5 other locations - About 4 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 595..602
      tensorflow/python/training/warm_starting_util_test.py on lines 629..636
      tensorflow/python/training/warm_starting_util_test.py on lines 665..672
      tensorflow/python/training/warm_starting_util_test.py on lines 710..717
      tensorflow/python/training/warm_starting_util_test.py on lines 753..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 81.

      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 6 locations. Consider refactoring.
      Open

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([real_bucket], partitioner)
              self.evaluate(variables.global_variables_initializer())
              # Without warm-starting, the weights should be initialized using default
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 5 other locations - About 4 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 566..573
      tensorflow/python/training/warm_starting_util_test.py on lines 595..602
      tensorflow/python/training/warm_starting_util_test.py on lines 629..636
      tensorflow/python/training/warm_starting_util_test.py on lines 665..672
      tensorflow/python/training/warm_starting_util_test.py on lines 710..717

      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 81.

      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 6 locations. Consider refactoring.
      Open

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_vocab], partitioner)
              self.evaluate(variables.global_variables_initializer())
              # Without warm-starting, the weights should be initialized using default
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 5 other locations - About 4 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 566..573
      tensorflow/python/training/warm_starting_util_test.py on lines 595..602
      tensorflow/python/training/warm_starting_util_test.py on lines 665..672
      tensorflow/python/training/warm_starting_util_test.py on lines 710..717
      tensorflow/python/training/warm_starting_util_test.py on lines 753..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 81.

      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 6 locations. Consider refactoring.
      Open

          with ops.Graph().as_default() as g:
            with self.session(graph=g) as sess:
              cols_to_vars = self._create_linear_model([sc_vocab], partitioner)
              self.evaluate(variables.global_variables_initializer())
              # Without warm-starting, the weights should be initialized using default
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 5 other locations - About 4 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 566..573
      tensorflow/python/training/warm_starting_util_test.py on lines 595..602
      tensorflow/python/training/warm_starting_util_test.py on lines 629..636
      tensorflow/python/training/warm_starting_util_test.py on lines 665..672
      tensorflow/python/training/warm_starting_util_test.py on lines 753..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 81.

      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

              ws_util.warm_start(
                  self.get_temp_dir(),
                  vars_to_warm_start=".*(sc_keys|sc_vocab).*",
                  var_name_to_vocab_info={
                      ws_util._infer_var_name(cols_to_vars[sc_vocab]): vocab_info
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 972..979

      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

              ws_util.warm_start(
                  self.get_temp_dir(),
                  vars_to_warm_start=".*(sc_keys|sc_vocab).*",
                  var_name_to_vocab_info={
                      ws_util._infer_var_name(cols_to_vars[sc_vocab]): vocab_info
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 909..916

      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 2 locations. Consider refactoring.
      Open

        def _write_vocab(self, string_values, file_name):
          vocab_file = os.path.join(self.get_temp_dir(), file_name)
          with open(vocab_file, "w") as f:
            f.write("\n".join(string_values))
          return vocab_file
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/feature_column/sequence_feature_column_test.py on lines 249..253

      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 4 locations. Consider refactoring.
      Open

          def _partitioner(shape, dtype):  # pylint:disable=unused-argument
            # Partition each var into 2 equal slices.
            partitions = [1] * len(shape)
            partitions[0] = min(2, shape.dims[0].value)
            return partitions
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 894..898
      tensorflow/python/training/warm_starting_util_test.py on lines 1080..1084
      tensorflow/python/training/warm_starting_util_test.py on lines 1150..1154

      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 4 locations. Consider refactoring.
      Open

          def _partitioner(shape, dtype):  # pylint:disable=unused-argument
            # Partition each var into 2 equal slices.
            partitions = [1] * len(shape)
            partitions[0] = min(2, shape.dims[0].value)
            return partitions
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1020..1024
      tensorflow/python/training/warm_starting_util_test.py on lines 1080..1084
      tensorflow/python/training/warm_starting_util_test.py on lines 1150..1154

      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 4 locations. Consider refactoring.
      Open

          def _partitioner(shape, dtype):  # pylint:disable=unused-argument
            # Partition each var into 2 equal slices.
            partitions = [1] * len(shape)
            partitions[0] = min(2, shape.dims[0].value)
            return partitions
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 894..898
      tensorflow/python/training/warm_starting_util_test.py on lines 1020..1024
      tensorflow/python/training/warm_starting_util_test.py on lines 1150..1154

      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 4 locations. Consider refactoring.
      Open

          def _partitioner(shape, dtype):  # pylint:disable=unused-argument
            # Partition each var into 2 equal slices.
            partitions = [1] * len(shape)
            partitions[0] = min(2, shape.dims[0].value)
            return partitions
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 894..898
      tensorflow/python/training/warm_starting_util_test.py on lines 1020..1024
      tensorflow/python/training/warm_starting_util_test.py on lines 1080..1084

      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

              fruit_weights = variable_scope.get_variable(
                  "fruit_weights",
                  shape=[6, 1],
                  initializer=[[0.], [0.], [0.], [0.], [0.], [0.]],
                  partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 328..332

      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

              fruit_weights = variable_scope.get_variable(
                  "fruit_weights",
                  shape=[6, 1],
                  initializer=[[0.], [0.], [0.], [0.], [0.], [0.]],
                  partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 397..401

      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

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

          _, weights = self._create_prev_run_var(
              "fruit_weights",
              shape=[4, 1],
              initializer=[[0.5], [1.], [1.5], [2.]],
              partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 169..173

      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 2 locations. Consider refactoring.
      Open

          _, weights = self._create_prev_run_var(
              "old_scope/fruit_weights",
              shape=[4, 1],
              initializer=[[0.5], [1.], [1.5], [2.]],
              partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 129..133

      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

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

          self._create_prev_run_var(
              "fruit_output_layer",
              shape=[4, 2],
              initializer=[[0.5, 0.3], [1., 0.8], [1.5, 1.2], [2., 2.3]],
              partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 291..295

      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 49.

      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

          self._create_prev_run_var(
              "fruit_output_layer",
              shape=[4, 2],
              initializer=[[0.5, 0.3], [1., 0.8], [1.5, 1.2], [2., 2.3]],
              partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 415..419

      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 49.

      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

              fruit_weights = variable_scope.get_variable(
                  "fruit_weights",
                  shape=[4, 1],
                  initializer=[[0.], [0.], [0.], [0.]],
                  partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 178..182

      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 47.

      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

              fruit_weights = variable_scope.get_variable(
                  "new_scope/fruit_weights",
                  shape=[4, 1],
                  initializer=[[0.], [0.], [0.], [0.]],
                  partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 152..156

      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 47.

      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

          self._create_prev_run_var(
              "fruit_weights",
              shape=[4, 1],
              initializer=[[0.5], [1.], [1.5], [2.]],
              partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 384..388

      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 2 locations. Consider refactoring.
      Open

          self._create_prev_run_var(
              "fruit_weights",
              shape=[4, 1],
              initializer=[[0.5], [1.], [1.5], [2.]],
              partitioner=lambda shape, dtype: [2, 1])
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 269..273

      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 2 locations. Consider refactoring.
      Open

              vocab_info = ws_util.VocabInfo(
                  new_vocab=sc_vocab.vocabulary_file,
                  new_vocab_size=sc_vocab.vocabulary_size,
                  num_oov_buckets=sc_vocab.num_oov_buckets,
                  old_vocab=prev_vocab_path,
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1175..1182

      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

              new_val = np.concatenate(
                  [fruit_weights[0].eval(sess), fruit_weights[1].eval(sess)], axis=0)
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 191..192

      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

              new_val = np.concatenate(
                  [fruit_weights[0].eval(sess), fruit_weights[1].eval(sess)], axis=0)
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 164..165

      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

              vocab_info = ws_util.VocabInfo(
                  new_vocab=sc_vocab.vocabulary_file,
                  new_vocab_size=sc_vocab.vocabulary_size,
                  num_oov_buckets=sc_vocab.num_oov_buckets,
                  old_vocab=prev_vocab_path,
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1103..1110

      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

              x = variable_scope.get_variable(
                  "x",
                  shape=[4, 1],
                  initializer=ones(),
                  partitioner=lambda shape, dtype: [2, 1])
      Severity: Minor
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 50 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1211..1215

      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

          x = variable_scope.get_variable(
              "x",
              shape=[4, 1],
              initializer=ones(),
              partitioner=lambda shape, dtype: [2, 1])
      Severity: Minor
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 50 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1224..1228

      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

                  sc_vocab: [
                      np.array([[3.], [2.], [1.]]),
                      np.array([[0.5], [0.], [0.]])
      Severity: Minor
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 45 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 927..929

      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

                  sc_vocab: [
                      np.array([[3.], [2.], [1.]]),
                      np.array([[0.5], [0.], [0.]])
      Severity: Minor
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 45 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1058..1060

      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

              with variable_scope.variable_scope("", partitioner=_partitioner):
                # Create the variables.
                fc.input_layer(
                    features=self._create_dummy_inputs(),
      Severity: Minor
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 45 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1167..1170

      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

              with variable_scope.variable_scope("", partitioner=_partitioner):
                # Create the variables.
                fc.linear_model(
                    features=self._create_dummy_inputs(),
      Severity: Minor
      Found in tensorflow/python/training/warm_starting_util_test.py and 1 other location - About 45 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 1097..1100

      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 4 locations. Consider refactoring.
      Open

              self.assertAllClose([[2.], [1.5], [1.]],
                                  fruit_weights_vars[0].eval(sess))
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 30 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 346..347
      tensorflow/python/training/warm_starting_util_test.py on lines 408..409
      tensorflow/python/training/warm_starting_util_test.py on lines 410..411

      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 4 locations. Consider refactoring.
      Open

              self.assertAllClose([[0.5], [0.], [0.]],
                                  fruit_weights_vars[1].eval(sess))
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 30 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 344..345
      tensorflow/python/training/warm_starting_util_test.py on lines 408..409
      tensorflow/python/training/warm_starting_util_test.py on lines 410..411

      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 4 locations. Consider refactoring.
      Open

              self.assertAllClose([[2.], [1.5], [1.]],
                                  fruit_weights_vars[0].eval(sess))
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 30 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 344..345
      tensorflow/python/training/warm_starting_util_test.py on lines 346..347
      tensorflow/python/training/warm_starting_util_test.py on lines 410..411

      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 4 locations. Consider refactoring.
      Open

              self.assertAllClose([[0.5], [0.], [0.]],
                                  fruit_weights_vars[1].eval(sess))
      Severity: Major
      Found in tensorflow/python/training/warm_starting_util_test.py and 3 other locations - About 30 mins to fix
      tensorflow/python/training/warm_starting_util_test.py on lines 344..345
      tensorflow/python/training/warm_starting_util_test.py on lines 346..347
      tensorflow/python/training/warm_starting_util_test.py on lines 408..409

      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