UTD-CRSS/app.exploreapollo.org

View on GitHub

Showing 64 of 270 total issues

Function componentDidMount has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async componentDidMount() {
    const moments = await fetch(`${config.apiEntry}/api/moments/random`);
    const momentJson = await moments.json();
    let momentId = fromJS(momentJson.id);
    const momentMedia = fromJS(momentJson.media);
Severity: Minor
Found in src/containers/DJ/index.js - About 1 hr to fix

    Function googleAnalytics has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function googleAnalytics(store) {
      const gaMomentEventCategory = "Moment";
      const gaPlayTimeEventAction = "playTime";
      const gaPlayTimeEventIntervalInMilliseconds = 5000;
    
    
    Severity: Minor
    Found in src/middleware.js - About 1 hr to fix

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

        render() {
          // const {
          //   loading,
          //   currentStory,
          //   currentStoryId,
      Severity: Minor
      Found in src/containers/PlaylistViewer/index.js - About 1 hr to fix

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

          render() {
            const mission = this.props.match?.params?.mission;
            const channels = this.state.selectedChannels;
            const {loading, data, tapeId, minBlock, maxBlock} = this.state;
            if (!channels || (data && Object.keys(data).lengh === 0)) {
        Severity: Minor
        Found in src/containers/ChannelsLoader/index.js - About 1 hr to fix

          Function componentDidUpdate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            componentDidUpdate() {
              const transcripts = this.state.transcripts;
              // DOM for timeline
              // only need this when transcripts are displayed
              if (
          Severity: Minor
          Found in src/components/ChannelPlayer/index.js - About 1 hr to fix

            Function formSpeakers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function formSpeakers(data) {
              if (typeof data == "undefined") {
                return [];
              }
            
            
            Severity: Minor
            Found in src/components/ChordDiagram/index.js - About 1 hr to fix

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

                render() {
                  const classes = classNames("timeline-container", "panel", "panel-default");
                  return (
                    <div className="col-md-6">
                      <div style={{ position: "relative", width: "100%", height: "100%" }}>
              Severity: Minor
              Found in src/components/Timeline/index.js - About 1 hr to fix

                Function renderSearchResults has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const renderSearchResults = () => {
                      const { loading, searching, moments } = this.state;
                
                      if (loading && searching) {
                        return (
                Severity: Minor
                Found in src/containers/Search/index.js - About 1 hr to fix

                  Function renderCards has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    renderCards() {
                      // const {landmarks} = this.props;
                      let landmarks = []; //TEMPORARY UNTIL WE GET LANDMARKS SORTED OUT :)
                      const moments = this.props.story.momentList;
                      const cards = _.sortBy(moments.concat(landmarks), "met_start");
                  Severity: Minor
                  Found in src/components/StoryTimeline/index.js - About 1 hr to fix

                    Function formInteractions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function formInteractions(data) {
                      if (typeof data == "undefined") {
                        return [];
                      }
                    
                    
                    Severity: Minor
                    Found in src/components/ChordDiagram/index.js - About 1 hr to fix

                      Function componentDidUpdate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                        componentDidUpdate() {
                          let parent = ReactDOM.findDOMNode(this).children[2].children[1].children[0];
                          console.log(parent);
                          let timeline;
                          let scrollHeight = 0;
                      Severity: Minor
                      Found in src/containers/MomentViewer/index.js - About 1 hr 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 BlockSelectMenu has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const BlockSelectMenu = (props) => {
                        const { handleValueChange, blockIndex, minBlock, maxBlock } = props;
                      
                        var blockIndexArr = [];
                        for (var i = minBlock; i <= maxBlock; i++) {
                      Severity: Minor
                      Found in src/containers/Channels/index.js - About 1 hr to fix

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

                          componentDidUpdate() {
                            let parent = ReactDOM.findDOMNode(this).children[2].children[1].children[0];
                            console.log(parent);
                            let timeline;
                            let scrollHeight = 0;
                        Severity: Minor
                        Found in src/containers/MomentViewer/index.js - About 1 hr to fix

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

                            render() {
                              return (
                                <div className="app-container">
                                  <AppHeader />
                                  <h1 className="center">
                          Severity: Minor
                          Found in src/containers/InTheNews/index.js - About 1 hr to fix

                            Function render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              render() {
                                const { onEnd, autoplay } = this.props;
                            
                                let loading = this.state.loading;
                                let transcripts = this.state.transcript;
                            Severity: Minor
                            Found in src/containers/MomentViewer/index.js - About 55 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function getTranscriptsTrs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            async function getTranscriptsTrs(url) {
                              var rawTranscriber;
                              var transcripts = [];
                              await fetch(url)
                                .then((response) => {
                            Severity: Minor
                            Found in src/containers/ChannelsLoader/getTranscripts.js - About 55 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function getActiveIndex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export default function getActiveIndex(transcripts, currentMissionTime) {
                              if (
                                transcripts == null ||
                                transcripts.length < 1 ||
                                currentMissionTime == 0
                            Severity: Minor
                            Found in src/containers/MomentViewer/getActiveIndex.js - About 45 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function getActiveIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export default function getActiveIndex(transcripts, currentMissionTime) {
                              if (
                                transcripts == null ||
                                transcripts.length < 1 ||
                                currentMissionTime == 0
                            Severity: Minor
                            Found in src/components/ChannelPlayer/getActiveIndex.js - About 35 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              render() {
                                const renderSearchResults = () => {
                                  const { loading, searching, moments } = this.state;
                            
                                  if (loading && searching) {
                            Severity: Minor
                            Found in src/containers/Search/index.js - About 35 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function timelineClickEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              timelineClickEvent(startTime) {
                                //tolerance is to prevent number comparisons from being incorrect due to the very last decimal
                                //because if the startTime and this.state.audio.time are not "equal" then the code will
                                //create an infinite loop which will crash the momentViewer. We only experienced this issue on
                                //moment 5 for some reason, and adding a tolerance was the simplest way to fix it after
                            Severity: Minor
                            Found in src/components/ChannelPlayer/index.js - About 35 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Severity
                            Category
                            Status
                            Source
                            Language