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
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;
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);
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;
- Read upRead up
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: {
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
- Read upRead up
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 () => {
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([]);
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;
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);
- Read upRead up
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([]);
- Read upRead up
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 = [];
Function VideoAssessment
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const VideoAssessment = (props) => {
let mediaRecorder;
let constraintObj = {
audio: false,
video: {
- Read upRead up
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");
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() {
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,
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);
- Read upRead up
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({
Function QuizLandingPage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const QuizLandingPage = (props) => {
let history = useHistory();
const { id } = useParams();
const handleQuizSubmit = () => {
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);