tensorflow/tensorflow

View on GitHub
tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File csv_dataset_test.py has 530 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#  Copyright 2018 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/data/experimental/kernel_tests/csv_dataset_test.py - About 1 day to fix

    CsvDatasetTest has 57 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class CsvDatasetTest(test_base.DatasetTestBase, parameterized.TestCase):
    
      def _setup_files(self, inputs, linebreak='\n', compression_type=None):
        filenames = []
        for i, file_rows in enumerate(inputs):
    Severity: Major
    Found in tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py - About 1 day to fix

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

        def _test_dataset(
      Severity: Major
      Found in tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py - About 50 mins to fix

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

          def _test_dataset_on_buffer_sizes(self,
        Severity: Minor
        Found in tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py - About 45 mins to fix

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

            def _setup_files(self, inputs, linebreak='\n', compression_type=None):
              filenames = []
              for i, file_rows in enumerate(inputs):
                fn = os.path.join(self.get_temp_dir(), 'temp_%d.csv' % i)
                contents = linebreak.join(file_rows).encode('utf-8')
          Severity: Minor
          Found in tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

                if compression_type is None:
                  with open(fn, 'wb') as f:
                    f.write(contents)
                elif compression_type == 'GZIP':
                  with gzip.GzipFile(fn, 'wb') as f:
          tensorflow/python/data/experimental/kernel_tests/make_csv_dataset_test.py on lines 49..60

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testIgnoreErrWithUnquotedQuotes(self):
              record_defaults = [['']] * 3
              inputs = [['1,2"3,4', 'a,b,c"d', '9,8"7,6,5', 'e,f,g']]
              filenames = self._setup_files(inputs)
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 151..158

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testIgnoreErrWithUnescapedQuotes(self):
              record_defaults = [['']] * 3
              inputs = [['1,"2"3",4', '1,"2"3",4",5,5', 'a,b,"c"d"', 'e,f,g']]
              filenames = self._setup_files(inputs)
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 160..167

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithGzipCompressionType(self):
              record_defaults = [['NA']] * 3
              inputs = [['"\n\n\n","\r\r\r","abc"', '"0","1","2"', '"","",""']]
              expected = [['\n\n\n', '\r\r\r', 'abc'], ['0', '1', '2'],
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 550..558

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithZlibCompressionType(self):
              record_defaults = [['NA']] * 3
              inputs = [['"\n\n\n","\r\r\r","abc"', '"0","1","2"', '"","",""']]
              expected = [['\n\n\n', '\r\r\r', 'abc'], ['0', '1', '2'],
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 537..545

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithCRLFAndQuoted(self):
              # Test that when the line separator is '\r\n', parsing works with all buffer
              # sizes
              record_defaults = [['NA']] * 3
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 478..484
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 486..494
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 496..504
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 506..513
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 515..524

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithLF(self):
              record_defaults = [['NA']] * 3
              inputs = [['abc,def,ghi', '0,1,2', ',,']]
              expected = [['abc', 'def', 'ghi'], ['0', '1', '2'], ['NA', 'NA', 'NA']]
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 486..494
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 496..504
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 506..513
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 515..524
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 526..535

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithCR(self):
              # Test that when the line separator is '\r', parsing works with all buffer
              # sizes
              record_defaults = [['NA']] * 3
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 478..484
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 496..504
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 506..513
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 515..524
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 526..535

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithBufferSizeAndQuoted(self):
              record_defaults = [['NA']] * 3
              inputs = [['"\n\n\n","\r\r\r","abc"', '"0","1","2"', '"","",""']]
              expected = [['\n\n\n', '\r\r\r', 'abc'], ['0', '1', '2'],
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 478..484
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 486..494
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 496..504
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 515..524
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 526..535

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithCRLF(self):
              # Test that when the line separator is '\r\n', parsing works with all buffer
              # sizes
              record_defaults = [['NA']] * 3
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 478..484
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 486..494
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 506..513
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 515..524
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 526..535

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithCRAndQuoted(self):
              # Test that when the line separator is '\r', parsing works with all buffer
              # sizes
              record_defaults = [['NA']] * 3
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 478..484
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 486..494
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 496..504
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 506..513
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 526..535

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithNewLine(self):
              # In this case, we expect it to behave differently from
              # TextLineDataset->map(decode_csv) since that flow has bugs
              record_defaults = [['']] * 4
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 422..429

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithMultipleNewLines(self):
              # In this case, we expect it to behave differently from
              # TextLineDataset->map(decode_csv) since that flow has bugs
              record_defaults = [['']] * 4
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 362..369

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithOneCol(self):
              record_defaults = [['NA']]
              inputs = [['0', '', '2']]
              self._test_dataset(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 355..360

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithOneColAndQuotes(self):
              record_defaults = [['']]
              inputs = [['"0"', '"1"', '"2"']]
              self._test_dataset(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 225..230

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testWithNaValue(self):
              record_defaults = [[0]] * 4
              inputs = [['1,NA,3,4', 'NA,6,7,8']]
              self._test_by_comparison(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 194..198

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 59.

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

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

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

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

          Refactorings

          Further Reading

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

            @combinations.generate(test_base.default_test_combinations())
            def testWithFieldDelim(self):
              record_defaults = [[0]] * 4
              inputs = [['1:2:3:4', '5:6:7:8']]
              self._test_by_comparison(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 201..205

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 59.

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

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

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

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

          Refactorings

          Further Reading

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

            @combinations.generate(test_base.default_test_combinations())
            def testErrWithUnescapedQuotes(self):
              record_defaults = [['']] * 3
              inputs = [['"a"b","c","d"']]
              self._test_dataset(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 132..136
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 431..435

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

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

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

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

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

          Refactorings

          Further Reading

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

            @combinations.generate(test_base.default_test_combinations())
            def testErrWithUnquotedQuotes(self):
              record_defaults = [['']] * 3
              inputs = [['1,2"3,4']]
              self._test_dataset(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 141..145
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 431..435

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

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

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

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

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

          Refactorings

          Further Reading

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

            @combinations.generate(test_base.default_test_combinations())
            def testErrorWithTerminateMidRecord(self):
              record_defaults = [['']] * 4
              inputs = [['a,b,c,"a']]
              self._test_dataset(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 132..136
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 141..145

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testErrorWithMoreDefaultsThanFields(self):
              record_defaults = [[0.0]] * 5
              inputs = [['0,1,2,3']]
              self._test_dataset(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 254..258

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testErrorWithFewerDefaultsThanFields(self):
              record_defaults = [[0.0]] * 2
              inputs = [['0,1,2,3']]
              self._test_dataset(
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 263..267

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

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

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

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

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

          Refactorings

          Further Reading

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

            @combinations.generate(test_base.default_test_combinations())
            def testWithEscapedQuotes(self):
              record_defaults = [['']] * 4
              inputs = [['1.0,2.1,"she said: ""hello""",4.3', '5.4,6.5,goodbye,8.7']]
              self._test_by_comparison(inputs, record_defaults=record_defaults)
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 118..122
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 349..353

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

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

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

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

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

          Refactorings

          Further Reading

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

            @combinations.generate(test_base.default_test_combinations())
            def testString(self):
              record_defaults = [['']] * 4
              inputs = [['1.0,2.1,hello,4.3', '5.4,6.5,goodbye,8.7']]
              self._test_by_comparison(inputs, record_defaults=record_defaults)
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 349..353
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 441..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 56.

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

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

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

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

          Refactorings

          Further Reading

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

            @combinations.generate(test_base.default_test_combinations())
            def testWithQuoted(self):
              record_defaults = [['']] * 4
              inputs = [['"a","b","c :)","d"', '"e","f","g :(","h"']]
              self._test_by_comparison(inputs, record_defaults=record_defaults)
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 118..122
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 441..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 56.

          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

            @combinations.generate(test_base.default_test_combinations())
            def testInt(self):
              record_defaults = [[0]] * 4
              inputs = [['1,2,3,4', '5,6,7,8']]
              self._test_by_comparison(inputs, record_defaults=record_defaults)
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 112..116

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

          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

            @combinations.generate(test_base.default_test_combinations())
            def testFloat(self):
              record_defaults = [[0.0]] * 4
              inputs = [['1.0,2.1,3.2,4.3', '5.4,6.5,7.6,8.7']]
              self._test_by_comparison(inputs, record_defaults=record_defaults)
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 106..110

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

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

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

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

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

          Refactorings

          Further Reading

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

              self._test_dataset(
                  inputs, [[0, 0, 0, 0], [1, 1, 1, 0], [0, 2, 2, 2]],
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 567..568
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 583..585

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

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

              with self.assertRaisesWithPredicateMatch(*err_spec):
                self._test_dataset(
                    inputs, [[0, 0, 0, 0], [1, 1, 1, 0], [0, 2, 2, 2]],
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 128..129
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 567..568

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

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

              self._test_dataset(
                  inputs, [[0, 0, 0, 0], [1, 1, 1, 0], [0, 2, 2, 2]],
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 128..129
          tensorflow/python/data/experimental/kernel_tests/csv_dataset_test.py on lines 583..585

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status