cBioPortal/clinical-timeline

View on GitHub

Showing 92 of 92 total issues

Avoid deeply nested control flow statements.
Open

          for (i=minTime.toDays(); i <= maxTime.toDays(); i++) {
              tickValues.push(i);
          }
Severity: Major
Found in js/clinicalTimeline.js - About 45 mins to fix

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

        diffTicksSVGPreTrim = d3.transform(d3.select($(divId+" .axis .tick")[1]).attr("transform")).translate[0] - d3.transform(d3.select($(divId+" .axis .tick")[0]).attr("transform")).translate[0],
    Severity: Minor
    Found in js/plugins/trimTimeline.js and 1 other location - About 45 mins to fix
    js/plugins/trimTimeline.js on lines 188..188

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 45.

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

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

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

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

    Refactorings

    Further Reading

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

      timeline.data = function (data) {
        if (!arguments.length) return allData;
        allData = data;
        return timeline;
      };
    Severity: Major
    Found in js/clinicalTimeline.js and 5 other locations - About 40 mins to fix
    js/clinicalTimeline.js on lines 941..945
    js/clinicalTimeline.js on lines 953..957
    js/clinicalTimeline.js on lines 965..969
    js/clinicalTimeline.js on lines 998..1002
    js/clinicalTimeline.js on lines 1010..1014

    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

    clinicalTimelineExporter.prototype.remove = function(timeline, spec) {
      $(spec.exportDivId).css("visibility", "hidden");
    }
    Severity: Minor
    Found in js/plugins/exportTimeline.js and 1 other location - About 40 mins to fix
    js/plugins/verticalLine.js on lines 102..104

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

      timeline.plugins = function (plugins) {
        if (!arguments.length) return clinicalTimelinePlugins;
        clinicalTimelinePlugins = plugins;
        return timeline;
      };
    Severity: Major
    Found in js/clinicalTimeline.js and 5 other locations - About 40 mins to fix
    js/clinicalTimeline.js on lines 941..945
    js/clinicalTimeline.js on lines 953..957
    js/clinicalTimeline.js on lines 965..969
    js/clinicalTimeline.js on lines 986..990
    js/clinicalTimeline.js on lines 998..1002

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

      timeline.enableTrackTooltips = function(b) {
        if (!arguments.length) return enableTrackTooltips;
        enableTrackTooltips = b;
        return timeline;
      };
    Severity: Major
    Found in js/clinicalTimeline.js and 5 other locations - About 40 mins to fix
    js/clinicalTimeline.js on lines 953..957
    js/clinicalTimeline.js on lines 965..969
    js/clinicalTimeline.js on lines 986..990
    js/clinicalTimeline.js on lines 998..1002
    js/clinicalTimeline.js on lines 1010..1014

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

      timeline.width = function (w) {
        if (!arguments.length) return width;
        width = w;
        return timeline;
      };
    Severity: Major
    Found in js/clinicalTimeline.js and 5 other locations - About 40 mins to fix
    js/clinicalTimeline.js on lines 941..945
    js/clinicalTimeline.js on lines 965..969
    js/clinicalTimeline.js on lines 986..990
    js/clinicalTimeline.js on lines 998..1002
    js/clinicalTimeline.js on lines 1010..1014

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

      timeline.overviewAxisWidth = function (w) {
        if (!arguments.length) return overviewAxisWidth;
        overviewAxisWidth = w;
        return timeline;
      };
    Severity: Major
    Found in js/clinicalTimeline.js and 5 other locations - About 40 mins to fix
    js/clinicalTimeline.js on lines 941..945
    js/clinicalTimeline.js on lines 953..957
    js/clinicalTimeline.js on lines 986..990
    js/clinicalTimeline.js on lines 998..1002
    js/clinicalTimeline.js on lines 1010..1014

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

      timeline.divId = function (name) {
        if (!arguments.length) return divId;
        divId = name;
        return timeline;
      };
    Severity: Major
    Found in js/clinicalTimeline.js and 5 other locations - About 40 mins to fix
    js/clinicalTimeline.js on lines 941..945
    js/clinicalTimeline.js on lines 953..957
    js/clinicalTimeline.js on lines 965..969
    js/clinicalTimeline.js on lines 986..990
    js/clinicalTimeline.js on lines 1010..1014

    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

    clinicalTimelineVerticalLine.prototype.remove = function(timeline, spec) {
      $(spec.tooltipControllerId).css("visibility", "hidden");
    }
    Severity: Minor
    Found in js/plugins/verticalLine.js and 1 other location - About 40 mins to fix
    js/plugins/exportTimeline.js on lines 123..125

    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

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

      function zoomExplanation(divId, svg, text, visibility, pos) {
    Severity: Minor
    Found in js/plugins/zoom.js - About 35 mins to fix

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

          hoverLine = hoverLineGroup
            .append("line")
            .attr("x1", 0)
            .attr("x2", 0) 
            .attr("y1", 20)
      Severity: Minor
      Found in js/plugins/verticalLine.js and 1 other location - About 35 mins to fix
      js/plugins/helperLines.js on lines 47..51

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

            helperLineGroup.append("rect")
              .attr("width", 120)
              .attr("height", 14)
              .attr("x", 0)
              .attr("y", elementYCoordinate - 7)
      Severity: Minor
      Found in js/plugins/helperLines.js and 1 other location - About 35 mins to fix
      js/plugins/verticalLine.js on lines 20..25

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

        timeline.zoomFactor = function (zFactor) {
          if (!arguments.length) return zoomFactor;
          zoomFactor = zFactor;
        };
      Severity: Minor
      Found in js/clinicalTimeline.js and 2 other locations - About 35 mins to fix
      js/clinicalTimeline.js on lines 1052..1055
      js/clinicalTimeline.js on lines 1063..1066

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

        timeline.translateX = function (x){
          if (!arguments.length) return translateX;
          translateX = x;
        };
      Severity: Minor
      Found in js/clinicalTimeline.js and 2 other locations - About 35 mins to fix
      js/clinicalTimeline.js on lines 1041..1044
      js/clinicalTimeline.js on lines 1052..1055

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

        timeline.overviewX = function (x) {
          if (!arguments.length) return overviewX;
          overviewX = x;
        };
      Severity: Minor
      Found in js/clinicalTimeline.js and 2 other locations - About 35 mins to fix
      js/clinicalTimeline.js on lines 1041..1044
      js/clinicalTimeline.js on lines 1063..1066

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

      Avoid too many return statements within this function.
      Open

            return time.d + "d";
      Severity: Major
      Found in js/clinicalTimeline.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return time.m + "m";
        Severity: Major
        Found in js/clinicalTimeline.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return "days";
          Severity: Major
          Found in js/clinicalTimeline.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return time.m + "m" + Math.abs(time.d) + "d";
            Severity: Major
            Found in js/clinicalTimeline.js - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language