Lambda-School-Labs/signlingo-fe

View on GitHub

Showing 22 of 74 total issues

Function ExerciseCard has 274 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ExerciseCard = (props) => {
  let history = useHistory();
  let { id } = useParams(); //id of the level
  const [currentIndex, setCurrentIndex] = useState(0); //index of the question we're showing to the user at the moment
  const [lives, setLives] = useState(3); //amount of lives user have
Severity: Major
Found in src/components/Exercises/ExerciseCard.js - About 1 day to fix

    Function DashboardCard has 231 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const DashboardCard = (props) => {
      const purl = process.env.PUBLIC_URL;
      const alphabet = 5; // num levels pertaining to alphabet
      const d = props.levelData;
      let flashcard;
    Severity: Major
    Found in src/components/Dashboard/DashboardCard.js - About 1 day to fix

      Function Quiz has 152 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Quiz = (props) => {
        const [data, setData] = useState(["dummy", "data"]);
        const [videoOn, setVideoOn] = useState(false);
        const [currentIndex, setCurrentIndex] = useState(0);
        const [enableButton, setEnableButton] = useState(false);
      Severity: Major
      Found in src/components/Quiz/Quiz.js - About 6 hrs to fix

        Function DashboardCard has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        const DashboardCard = (props) => {
          const purl = process.env.PUBLIC_URL;
          const alphabet = 5; // num levels pertaining to alphabet
          const d = props.levelData;
          let flashcard;
        Severity: Minor
        Found in src/components/Dashboard/DashboardCard.js - About 5 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 VideoAssessment has 115 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const VideoAssessment = (props) => {
          let mediaRecorder;
          let constraintObj = {
            audio: false,
            video: {
        Severity: Major
        Found in src/components/Quiz/VideoAssessment.js - About 4 hrs to fix

          Function ExerciseCard has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          const ExerciseCard = (props) => {
            let history = useHistory();
            let { id } = useParams(); //id of the level
            const [currentIndex, setCurrentIndex] = useState(0); //index of the question we're showing to the user at the moment
            const [lives, setLives] = useState(3); //amount of lives user have
          Severity: Minor
          Found in src/components/Exercises/ExerciseCard.js - About 4 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 LandingPage has 97 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const LandingPage = () => {
            let history = useHistory();
            const { authService } = useOktaAuth();
          
            const login = async () => {
          Severity: Major
          Found in src/components/Home/LandingPage.js - About 3 hrs to fix

            Function FlashcardWrapper has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const FlashcardWrapper = (props) => {
              let history = useHistory();
              const { id } = useParams();
              const [flashcardData, setFlashcardData] = useState([]);
              const [flipped, setFlipped] = useState([]);
            Severity: Major
            Found in src/components/Flashcards/FlashcardWrapper.js - About 2 hrs to fix

              File ExerciseCard.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useState } from "react";
              import { useParams, useHistory } from "react-router-dom";
              import { connect } from "react-redux";
              const purl = process.env.PUBLIC_URL;
              
              
              Severity: Minor
              Found in src/components/Exercises/ExerciseCard.js - About 2 hrs to fix

                Function Quiz has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                const Quiz = (props) => {
                  const [data, setData] = useState(["dummy", "data"]);
                  const [videoOn, setVideoOn] = useState(false);
                  const [currentIndex, setCurrentIndex] = useState(0);
                  const [enableButton, setEnableButton] = useState(false);
                Severity: Minor
                Found in src/components/Quiz/Quiz.js - 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 FlashcardWrapper has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                const FlashcardWrapper = (props) => {
                  let history = useHistory();
                  const { id } = useParams();
                  const [flashcardData, setFlashcardData] = useState([]);
                  const [flipped, setFlipped] = useState([]);
                Severity: Minor
                Found in src/components/Flashcards/FlashcardWrapper.js - 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 ExerciseWrapper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const ExerciseWrapper = (props) => {
                  const { id } = useParams();
                  let history = useHistory();
                  const [flashcardData, setFlashcardData] = useState([]);
                  let exerciseData = [];
                Severity: Major
                Found in src/components/Exercises/ExerciseWrapper.js - About 2 hrs to fix

                  Function VideoAssessment has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const VideoAssessment = (props) => {
                    let mediaRecorder;
                    let constraintObj = {
                      audio: false,
                      video: {
                  Severity: Minor
                  Found in src/components/Quiz/VideoAssessment.js - 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 Dashboard has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const Dashboard = (props) => {
                    const { authService } = useOktaAuth();
                  
                    function logout() {
                      localStorage.removeItem("oktaUID");
                  Severity: Minor
                  Found in src/components/Dashboard/Dashboard.js - About 1 hr to fix

                    Function ExerciseSuccess has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function ExerciseSuccess() {
                      let history = useHistory();
                      let { id } = useParams();
                    
                      function backToDash() {
                    Severity: Minor
                    Found in src/components/Exercises/ExerciseSuccess.js - About 1 hr to fix

                      Function levelsReducer has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const levelsReducer = (state = initialState, action) => {
                        switch (action.type) {
                          case GET_ALL_LEVELS_SUCCESS:
                            return {
                              ...state,
                      Severity: Minor
                      Found in src/reducers/levelsReducer.js - About 1 hr to fix

                        Function addLevelsToUserAccount has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const addLevelsToUserAccount = (levels, userLevels, oktaUID) => async (dispatch) => {
                          let levelsToAdd = []; // ends up containing all level_ids to add to user account
                          if (userLevels.length === 0) {
                            levels.forEach((level) => {
                              levelsToAdd.push(level.id);
                        Severity: Minor
                        Found in src/actions/levelsActions.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 constructor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          constructor(props) {
                            super(props);
                        
                            const { pkce, issuer, clientId, redirectUri, scopes } = config.oidc;
                            this.signIn = new OktaSignIn({
                        Severity: Minor
                        Found in src/components/Home/LoginAndRegister.js - About 1 hr to fix

                          Function QuizLandingPage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const QuizLandingPage = (props) => {
                            let history = useHistory();
                            const { id } = useParams();
                          
                            const handleQuizSubmit = () => {
                          Severity: Minor
                          Found in src/components/Quiz/QuizWrapper.js - About 1 hr to fix

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

                            export const addLevelsToUserAccount = (levels, userLevels, oktaUID) => async (dispatch) => {
                              let levelsToAdd = []; // ends up containing all level_ids to add to user account
                              if (userLevels.length === 0) {
                                levels.forEach((level) => {
                                  levelsToAdd.push(level.id);
                            Severity: Minor
                            Found in src/actions/levelsActions.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language