UTD-CRSS/app.exploreapollo.org

View on GitHub

Showing 270 of 270 total issues

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

  return (dispatch) => {
    dispatch(fetchMoments());
    fetch(`${config.apiEntry}/api/moments/${momentId}`)
      .then((response) => {
        return response.json();
Severity: Major
Found in src/actions/index.js and 1 other location - About 4 hrs to fix
src/actions/index.js on lines 55..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

export function loadPerson({ personId }) {
  return (dispatch) => {
    dispatch(fetchPerson());
    fetch(`${config.apiEntry}/api/people/${personId}`)
      .then((response) => {
Severity: Major
Found in src/actions/index.js and 1 other location - About 4 hrs to fix
src/actions/index.js on lines 129..140

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

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

export function loadMetrics({ momentId }) {
  return (dispatch) => {
    dispatch(fetchMetrics());
    fetch(`${config.apiEntry}/api/moments/${momentId}/metrics`)
      .then((response) => {
Severity: Major
Found in src/actions/index.js and 1 other location - About 4 hrs to fix
src/actions/index.js on lines 103..114

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

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 d3ChordDiagram has 101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default curry(function d3ChordDiagram(speakers, interactions, node) {
  //FIXME should be the innerwidth of the tab container, not the entire window
  var width = window.innerWidth / 2;
  var height = width;
  var innerRadius = Math.min(width, height) * 0.4;
Severity: Major
Found in src/components/ChordDiagram/d3ChordDiagram.js - About 4 hrs to fix

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

              <div className="timeline-scroller">
                <div className="transcript-panel">
                  <div className={classes}>
                    <div className="panel-heading">
                      <h3 className="panel-title">Transcript</h3>
    Severity: Major
    Found in src/components/ChannelTimeline/index.js and 1 other location - About 3 hrs to fix
    src/components/Timeline/index.js on lines 63..83

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 114.

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

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

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

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

    Refactorings

    Further Reading

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

              <div
                style={{
                  position: "absolute",
                  top: 0,
                  right: 0,
    Severity: Major
    Found in src/components/Timeline/index.js and 1 other location - About 3 hrs to fix
    src/components/ChannelTimeline/index.js on lines 72..84

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 114.

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

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

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

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

    Refactorings

    Further Reading

    Function checkDay has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      checkDay() {
        var mstart;
        var mend;
        const day = this.props.missionDay;
    
    
    Severity: Major
    Found in src/components/Apollo11StoryTimeline/index.js - About 3 hrs to fix

      Function render has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          if (this.props.loading) {
            return (
              <div className="text-center lead">
                <p>Loading Stories...</p>
      Severity: Major
      Found in src/containers/Apollo11Explorer/index.js - About 3 hrs to fix

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

                  <div>
                    <div style={{ marginTop: "1em", marginLeft: "1em" }}>
                      <button
                        className="btn btn-lg momentStoryButton"
                        style={{ marginBottom: "0.5em" }}
        Severity: Major
        Found in src/components/MomentList/index.js and 1 other location - About 3 hrs to fix
        src/components/StoryList/index.js on lines 10..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 103.

        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

                <div>
                  <div style={{ marginTop: "1em", marginLeft: "1em" }}>
                    <button className="btn btn-lg momentStoryButton" style={{marginBottom: "0.5em"}}>
                      <a href={`/stories/story/${id}`}> Launch</a>
                    </button>
        Severity: Major
        Found in src/components/StoryList/index.js and 1 other location - About 3 hrs to fix
        src/components/MomentList/index.js on lines 11..20

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

        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

        File index.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { Component } from "react";
        import ReactDOM from "react-dom";
        import Spinner from "react-spinner";
        import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
        import config from "../../../config";
        Severity: Minor
        Found in src/containers/MomentViewer/index.js - About 3 hrs to fix

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

            async componentDidMount() {
              let currentStoryId = this.props.match.params.storyId;
              const response = await fetch(
                `${config.apiEntry}/api/stories/${currentStoryId}`
              );
          Severity: Major
          Found in src/containers/PlaylistViewer/index.js and 1 other location - About 3 hrs to fix
          src/containers/StoryViewer/index.js on lines 13..20

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

          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

            async componentDidMount() {
              let currentStoryId = this.props.match.params.storyId;
              const response = await fetch(
                `${config.apiEntry}/api/stories/${currentStoryId}`
              );
          Severity: Major
          Found in src/containers/StoryViewer/index.js and 1 other location - About 3 hrs to fix
          src/containers/PlaylistViewer/index.js on lines 23..30

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

          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

              it("should show a pause while playing", function () {
                const button = shallow(<PlayButton isPlaying={true} />);
                expect(button.find("img").hasClass("pause")).toBe(true);
                expect(button.find("img").hasClass("play")).toBe(false);
              });
          Severity: Major
          Found in src/components/MomentPlayer/index.test.js and 1 other location - About 3 hrs to fix
          src/components/MomentPlayer/index.test.js on lines 8..12

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

          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

              it("should show a play icon when paused", function () {
                const button = shallow(<PlayButton isPlaying={false} />);
                expect(button.find("img").hasClass("play")).toBe(true);
                expect(button.find("img").hasClass("pause")).toBe(false);
              });
          Severity: Major
          Found in src/components/MomentPlayer/index.test.js and 1 other location - About 3 hrs to fix
          src/components/MomentPlayer/index.test.js on lines 13..17

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

          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

          Channels has 27 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class Channels extends Component {
            constructor(props) {
              super(props);
              this.state = {
                channelsLoaded: false,
          Severity: Minor
          Found in src/containers/Channels/index.js - About 3 hrs to fix

            Function render has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                const {data, containerWidth} = this.props;
            
                //Don't render diagram without data
                if(data.series.every(datum => {return datum.value.size < 1;})) {
            Severity: Major
            Found in src/components/DashboardDiagram/index.js - About 3 hrs to fix

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

              function generateLegend(data) {
                var result = [];
                data.map((datum, index) => result.push(<span key={index} style={{color:D3.schemeCategory10[index]}}>&emsp;{datum.name}&emsp;</span>));
                return result;
              }
              Severity: Major
              Found in src/components/BarDiagram/index.js and 2 other locations - About 3 hrs to fix
              src/components/DashboardDiagram/index.js on lines 97..101
              src/components/LineDiagram/index.js on lines 129..139

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

              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

              function generateLegend(data) {
                var result = [];
                data.map((datum, index) => result.push(<span key={index} style={{color:D3.schemeCategory10[index]}}>&emsp;{datum.name}&emsp;</span>));
                return result;
              }
              Severity: Major
              Found in src/components/DashboardDiagram/index.js and 2 other locations - About 3 hrs to fix
              src/components/BarDiagram/index.js on lines 88..92
              src/components/LineDiagram/index.js on lines 129..139

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

              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 render has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  const url = "/apollo8/";
                  return (
                    <div className="app-container"> 
                      <AppHeader />
              Severity: Major
              Found in src/containers/Apollo8Explorer/index.js - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language