spolnik/JAlgoArena-UI

View on GitHub

Showing 386 of 386 total issues

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

function setSolvedProblemsRatio(solvedProblemsRatio: Array<ProblemSubmissionRatio>): Action {
return {
type: types.FETCH_PROBLEMS_SOLUTION_RATIO,
solvedProblemsRatio,
};
Severity: Major
Found in src/client/ranking/actions/index.ts and 3 other locations - About 30 mins to fix
src/client/ranking/actions/index.ts on lines 125..130
src/client/submissions/actions/index.ts on lines 40..45
src/client/users/actions/index.ts on lines 188..193

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

render() {
let regions = this.props.config.regions;
let teams = this.props.config.teams;
 
let regionOptions = regions.map(region => <option>{region}</option>);
Severity: Minor
Found in src/client/users/pages/signup.tsx - About 25 mins to fix

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

render() {
const {
problems,
problemsFilter,
submissions,
Severity: Minor
Found in src/client/problems/pages/problems.tsx - About 25 mins to fix

Function ProblemTitle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ProblemTitle = (props: ProblemTitleProps) => {
let acceptedSubmissions = props.submissions.filter(
(submission: Submission) => submission.statusCode === 'ACCEPTED'
);
let failedSubmissions = props.submissions.filter(
Severity: Minor
Found in src/client/problems/components/ProblemTitle.tsx - About 25 mins to fix

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

componentDidUpdate() {
if (this.props.auth.error === 'User name is already used') {
if(!this.state.isUserNameFieldIncorrect){
let newState = Object.assign({}, this.state, {isUserNameFieldIncorrect: true});
this.setState(newState);
Severity: Minor
Found in src/client/users/pages/signup.tsx - About 25 mins to fix

Function componentDidMount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

componentDidMount() {
let problemId = this.props.match.params.id;
 
if (store.getState().currentProblemId !== problemId) {
store.dispatch(setCurrentProblem(problemId));
Severity: Minor
Found in src/client/problems/pages/problem.tsx - About 25 mins to fix
Severity
Category
Status
Source
Language