enclose-io/compiler

View on GitHub
lts/deps/v8/tools/heap-stats/global-timeline.js

Summary

Maintainability
F
1 wk
Test Coverage

Function getFieldData has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getFieldData() {
    const labels = [
      {type: 'number', label: 'Time'},
      {type: 'number', label: 'Ptr compression benefit'},
      {type: 'string', role: 'tooltip'},
Severity: Major
Found in lts/deps/v8/tools/heap-stats/global-timeline.js - About 2 hrs to fix

    Function getChartOptions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getChartOptions() {
        const options = {
          isStacked: true,
          hAxis: {
            format: '###.##s',
    Severity: Minor
    Found in lts/deps/v8/tools/heap-stats/global-timeline.js - About 1 hr to fix

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

        getFieldData() {
          const labels = [
            {type: 'number', label: 'Time'},
            {type: 'number', label: 'Ptr compression benefit'},
            {type: 'string', role: 'tooltip'},
      Severity: Major
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 1 other location - About 4 days to fix
      current/deps/v8/tools/heap-stats/global-timeline.js on lines 63..122

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

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

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

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

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

      Refactorings

      Further Reading

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

        getCategoryData() {
          const categories = Object.keys(this.selection.categories)
                                 .map(k => this.selection.category_names.get(k));
          const labels = ['Time', ...categories];
          const chart_data = [labels];
      Severity: Major
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 1 other location - About 1 day to fix
      current/deps/v8/tools/heap-stats/global-timeline.js on lines 124..147

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

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

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

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

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

      Refactorings

      Further Reading

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

        getInstanceTypeData() {
          const instance_types =
              Object.values(this.selection.categories)
                  .reduce((accu, current) => accu.concat(current), []);
          const labels = ['Time', ...instance_types];
      Severity: Major
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 1 other location - About 1 day to fix
      current/deps/v8/tools/heap-stats/global-timeline.js on lines 149..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 246.

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

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

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

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

      Refactorings

      Further Reading

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

        getChartOptions() {
          const options = {
            isStacked: true,
            hAxis: {
              format: '###.##s',
      Severity: Major
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 1 other location - About 7 hrs to fix
      current/deps/v8/tools/heap-stats/global-timeline.js on lines 181..209

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

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

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

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

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

      Refactorings

      Further Reading

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

        drawChart() {
          console.assert(this.data, 'invalid data');
          console.assert(this.selection, 'invalid selection');
      
          const chart_data = this.getChartData();
      Severity: Major
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 1 other location - About 5 hrs to fix
      current/deps/v8/tools/heap-stats/global-timeline.js on lines 211..222

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

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

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

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

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

      Refactorings

      Further Reading

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

        getChartData() {
          switch (this.selection.data_view) {
            case VIEW_BY_FIELD_TYPE:
              return this.getFieldData();
            case VIEW_BY_INSTANCE_CATEGORY:
      Severity: Major
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 3 other locations - About 1 hr to fix
      current/deps/v8/tools/heap-stats/global-timeline.js on lines 169..179
      current/deps/v8/tools/heap-stats/histogram-viewer.js on lines 162..172
      lts/deps/v8/tools/heap-stats/histogram-viewer.js on lines 159..169

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

      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

        constructor() {
          super();
          const shadowRoot = this.attachShadow({mode: 'open'});
          shadowRoot.appendChild(global_timeline_template.content.cloneNode(true));
        }
      Severity: Major
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 1 other location - About 1 hr to fix
      lts/deps/v8/tools/heap-stats/histogram-viewer.js on lines 12..16

      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

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

        stateChanged() {
          if (this.isValid()) {
            this.drawChart();
          } else {
            this.hide();
      Severity: Minor
      Found in lts/deps/v8/tools/heap-stats/global-timeline.js and 1 other location - About 35 mins to fix
      current/deps/v8/tools/heap-stats/global-timeline.js on lines 55..61

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 46.

      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