tensorflow/models

View on GitHub
research/vid2depth/model.py

Summary

Maintainability
F
4 days
Test Coverage

Function build_loss has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

  def build_loss(self):
    """Adds ops for computing loss."""
    with tf.name_scope('compute_loss'):
      self.reconstr_loss = 0
      self.smooth_loss = 0
Severity: Minor
Found in research/vid2depth/model.py - About 7 hrs to fix

Cognitive Complexity

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

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

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

Further reading

File model.py has 302 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: Minor
Found in research/vid2depth/model.py - About 3 hrs to fix

    Function build_summaries has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      def build_summaries(self):
        """Adds scalar and image summaries for TensorBoard."""
        tf.summary.scalar('total_loss', self.total_loss)
        tf.summary.scalar('reconstr_loss', self.reconstr_loss)
        if self.smooth_weight > 0:
    Severity: Minor
    Found in research/vid2depth/model.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

      def __init__(self,
    Severity: Major
    Found in research/vid2depth/model.py - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                  if not self.legacy_mode or i == self.middle_frame_index:
                    self.smooth_loss += 1.0 / (2**s) * self.depth_smoothness(
                        self.disp[i][s], self.images[s][:, :, :, 3 * i:3 * (i + 1)])
      
      
      Severity: Major
      Found in research/vid2depth/model.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if self.icp_weight > 0:
                      cloud_a = self.cloud[j][s]
                      cloud_b = self.cloud[i][s]
                      self.icp_transform[s][key], self.icp_residual[s][key] = icp(
                          cloud_a, egomotion, cloud_b)
        Severity: Major
        Found in research/vid2depth/model.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if i == j or abs(i - j) != 1:
                        continue
                      # In legacy mode, only consider the middle frame as target.
                      if self.legacy_mode and j != self.middle_frame_index:
          Severity: Major
          Found in research/vid2depth/model.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if self.legacy_mode and j != self.middle_frame_index:
                          continue
                        source = self.images[s][:, :, :, 3 * i:3 * (i + 1)]
            Severity: Major
            Found in research/vid2depth/model.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if i > j:
                            # Need to inverse egomotion when going back in sequence.
                            egomotion_mult *= -1
                          # For compatiblity with SfMLearner, interpret all egomotion vectors
                          # as pointing toward the middle frame.  Note that unlike SfMLearner,
              Severity: Major
              Found in research/vid2depth/model.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if self.ssim_weight > 0:
                              self.ssim_error[s][key] = self.ssim(self.warped_image[s][key],
                                                                  target)
                              # TODO(rezama): This should be min_pool2d().
                              ssim_mask = slim.avg_pool2d(self.warp_mask[s][key], 3, 1, 'VALID')
                Severity: Major
                Found in research/vid2depth/model.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if self.legacy_mode:
                                if egomotion_index >= self.middle_frame_index:
                                  egomotion_mult *= -1
                              egomotion = egomotion_mult * self.egomotion[:, egomotion_index, :]
                  Severity: Major
                  Found in research/vid2depth/model.py - About 45 mins to fix

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

                                  self.icp_residual_loss += 1.0 / (2**s) * tf.reduce_mean(
                                      tf.abs(self.icp_residual[s][key]))
                    Severity: Major
                    Found in research/vid2depth/model.py and 1 other location - About 2 hrs to fix
                    research/vid2depth/model.py on lines 223..224

                    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

                                  self.icp_transform_loss += 1.0 / (2**s) * tf.reduce_mean(
                                      tf.abs(self.icp_transform[s][key]))
                    Severity: Major
                    Found in research/vid2depth/model.py and 1 other location - About 2 hrs to fix
                    research/vid2depth/model.py on lines 225..226

                    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

                                source = self.images[s][:, :, :, 3 * i:3 * (i + 1)]
                    Severity: Major
                    Found in research/vid2depth/model.py and 1 other location - About 1 hr to fix
                    research/vid2depth/model.py on lines 176..176

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

                    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

                                target = self.images[s][:, :, :, 3 * j:3 * (j + 1)]
                    Severity: Major
                    Found in research/vid2depth/model.py and 1 other location - About 1 hr to fix
                    research/vid2depth/model.py on lines 175..175

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

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

                            tf.summary.image('scale%d_warped_image%s' % (s, key),
                                             self.warped_image[s][key])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 301..301
                    research/vid2depth/model.py on lines 302..302
                    research/vid2depth/model.py on lines 303..303
                    research/vid2depth/model.py on lines 308..309
                    research/vid2depth/model.py on lines 310..311
                    research/vid2depth/model.py on lines 312..314
                    research/vid2depth/model.py on lines 316..317

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

                            tf.summary.image('scale%d_warp_mask%s' % (s, key),
                                             self.warp_mask[s][key])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 301..301
                    research/vid2depth/model.py on lines 302..302
                    research/vid2depth/model.py on lines 303..303
                    research/vid2depth/model.py on lines 306..307
                    research/vid2depth/model.py on lines 310..311
                    research/vid2depth/model.py on lines 312..314
                    research/vid2depth/model.py on lines 316..317

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

                              tf.summary.image('scale%d_disparity%d' % (s, i), self.disp[i][s])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 301..301
                    research/vid2depth/model.py on lines 302..302
                    research/vid2depth/model.py on lines 306..307
                    research/vid2depth/model.py on lines 308..309
                    research/vid2depth/model.py on lines 310..311
                    research/vid2depth/model.py on lines 312..314
                    research/vid2depth/model.py on lines 316..317

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

                              tf.summary.histogram('scale%d_depth%d' % (s, i), self.depth[i][s])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 302..302
                    research/vid2depth/model.py on lines 303..303
                    research/vid2depth/model.py on lines 306..307
                    research/vid2depth/model.py on lines 308..309
                    research/vid2depth/model.py on lines 310..311
                    research/vid2depth/model.py on lines 312..314
                    research/vid2depth/model.py on lines 316..317

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

                            if self.ssim_weight > 0:
                              tf.summary.image('scale%d_ssim_error%s' % (s, key),
                                               self.ssim_error[s][key])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 301..301
                    research/vid2depth/model.py on lines 302..302
                    research/vid2depth/model.py on lines 303..303
                    research/vid2depth/model.py on lines 306..307
                    research/vid2depth/model.py on lines 308..309
                    research/vid2depth/model.py on lines 310..311
                    research/vid2depth/model.py on lines 316..317

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

                              tf.summary.histogram('scale%d_disp%d' % (s, i), self.disp[i][s])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 301..301
                    research/vid2depth/model.py on lines 303..303
                    research/vid2depth/model.py on lines 306..307
                    research/vid2depth/model.py on lines 308..309
                    research/vid2depth/model.py on lines 310..311
                    research/vid2depth/model.py on lines 312..314
                    research/vid2depth/model.py on lines 316..317

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

                              tf.summary.image('scale%d_icp_residual%s' % (s, key),
                                               self.icp_residual[s][key])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 301..301
                    research/vid2depth/model.py on lines 302..302
                    research/vid2depth/model.py on lines 303..303
                    research/vid2depth/model.py on lines 306..307
                    research/vid2depth/model.py on lines 308..309
                    research/vid2depth/model.py on lines 310..311
                    research/vid2depth/model.py on lines 312..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 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 8 locations. Consider refactoring.
                    Open

                            tf.summary.image('scale%d_warp_error%s' % (s, key),
                                             self.warp_error[s][key])
                    Severity: Major
                    Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
                    research/vid2depth/model.py on lines 301..301
                    research/vid2depth/model.py on lines 302..302
                    research/vid2depth/model.py on lines 303..303
                    research/vid2depth/model.py on lines 306..307
                    research/vid2depth/model.py on lines 308..309
                    research/vid2depth/model.py on lines 312..314
                    research/vid2depth/model.py on lines 316..317

                    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

                                self.warped_image[s][key], self.warp_mask[s][key] = (
                    Severity: Minor
                    Found in research/vid2depth/model.py and 1 other location - About 35 mins to fix
                    research/vid2depth/model.py on lines 221..221

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 33.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                  self.icp_transform[s][key], self.icp_residual[s][key] = icp(
                    Severity: Minor
                    Found in research/vid2depth/model.py and 1 other location - About 35 mins to fix
                    research/vid2depth/model.py on lines 198..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 33.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          tf.summary.histogram('ry%d' % i, self.egomotion[:, i, 4])
                    Severity: Major
                    Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
                    research/vid2depth/model.py on lines 289..289
                    research/vid2depth/model.py on lines 290..290
                    research/vid2depth/model.py on lines 291..291
                    research/vid2depth/model.py on lines 292..292
                    research/vid2depth/model.py on lines 294..294

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

                          tf.summary.histogram('tx%d' % i, self.egomotion[:, i, 0])
                    Severity: Major
                    Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
                    research/vid2depth/model.py on lines 290..290
                    research/vid2depth/model.py on lines 291..291
                    research/vid2depth/model.py on lines 292..292
                    research/vid2depth/model.py on lines 293..293
                    research/vid2depth/model.py on lines 294..294

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

                          tf.summary.histogram('rx%d' % i, self.egomotion[:, i, 3])
                    Severity: Major
                    Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
                    research/vid2depth/model.py on lines 289..289
                    research/vid2depth/model.py on lines 290..290
                    research/vid2depth/model.py on lines 291..291
                    research/vid2depth/model.py on lines 293..293
                    research/vid2depth/model.py on lines 294..294

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

                          tf.summary.histogram('tz%d' % i, self.egomotion[:, i, 2])
                    Severity: Major
                    Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
                    research/vid2depth/model.py on lines 289..289
                    research/vid2depth/model.py on lines 290..290
                    research/vid2depth/model.py on lines 292..292
                    research/vid2depth/model.py on lines 293..293
                    research/vid2depth/model.py on lines 294..294

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

                          tf.summary.histogram('ty%d' % i, self.egomotion[:, i, 1])
                    Severity: Major
                    Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
                    research/vid2depth/model.py on lines 289..289
                    research/vid2depth/model.py on lines 291..291
                    research/vid2depth/model.py on lines 292..292
                    research/vid2depth/model.py on lines 293..293
                    research/vid2depth/model.py on lines 294..294

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

                          tf.summary.histogram('rz%d' % i, self.egomotion[:, i, 5])
                    Severity: Major
                    Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
                    research/vid2depth/model.py on lines 289..289
                    research/vid2depth/model.py on lines 290..290
                    research/vid2depth/model.py on lines 291..291
                    research/vid2depth/model.py on lines 292..292
                    research/vid2depth/model.py on lines 293..293

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 32.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        weights_y = tf.exp(-tf.reduce_mean(tf.abs(image_dy), 3, keepdims=True))
                    Severity: Minor
                    Found in research/vid2depth/model.py and 1 other location - About 30 mins to fix
                    research/vid2depth/model.py on lines 249..249

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 32.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        sigma_x = slim.avg_pool2d(x**2, 3, 1, 'VALID') - mu_x**2
                    Severity: Minor
                    Found in research/vid2depth/model.py and 1 other location - About 30 mins to fix
                    research/vid2depth/model.py on lines 262..262

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 32.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        sigma_y = slim.avg_pool2d(y**2, 3, 1, 'VALID') - mu_y**2
                    Severity: Minor
                    Found in research/vid2depth/model.py and 1 other location - About 30 mins to fix
                    research/vid2depth/model.py on lines 261..261

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 32.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        weights_x = tf.exp(-tf.reduce_mean(tf.abs(image_dx), 3, keepdims=True))
                    Severity: Minor
                    Found in research/vid2depth/model.py and 1 other location - About 30 mins to fix
                    research/vid2depth/model.py on lines 250..250

                    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