spolnik/JAlgoArena-UI

View on GitHub

Showing 31 of 386 total issues

File lodash_v4.x.x.js has 5178 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// flow-typed signature: 2d6372509af898546ea7b44735f2557d
// flow-typed version: 8c150a1c24/lodash_v4.x.x/flow_>=v0.63.x
 
declare module "lodash" {
declare type __CurriedFunction1<A, R, AA: A> = (...r: [AA]) => R;
Severity: Major
Found in flow-typed/npm/lodash_v4.x.x.js - About 2 wks to fix

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

    render() {
    const submissions = _.orderBy(this.props.submissions, ['submissionTime'], ['desc']);
     
    let submissionData = submissions.map((submission: Submission) => {
    return {
    Severity: Major
    Found in src/client/submissions/pages/submissions.tsx - About 3 hrs to fix

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

      render() {
      if (!this.props.problem) {
      return null;
      }
       
       
      Severity: Major
      Found in src/client/problems/pages/problem.tsx - About 3 hrs to fix

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

        render() {
        const {
        problems,
        problemsFilter,
        submissions,
        Severity: Major
        Found in src/client/problems/pages/problems.tsx - About 2 hrs to fix

          File problem.tsx has 285 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import * as React from 'react';
          import {Grid, Button, Row} from 'react-bootstrap';
          import {connect} from 'react-redux';
           
          import {store} from '../../common';
          Severity: Minor
          Found in src/client/problems/pages/problem.tsx - About 2 hrs to fix

            ProblemPage has 22 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class ProblemPage extends React.Component<ProblemProps, ProblemState> {
            constructor(props: ProblemProps) {
            super(props);
            this.state = {
            showListNodeSourceCode: false,
            Severity: Minor
            Found in src/client/problems/pages/problem.tsx - About 2 hrs to fix

              Function render has 56 lines of code (exceeds 25 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: Major
              Found in src/client/users/pages/signup.tsx - About 2 hrs to fix

                File submissions.tsx has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import * as React from 'react';
                import {Link} from 'react-router-dom';
                import {Button, Col, Grid, PageHeader, Row} from 'react-bootstrap';
                import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table';
                import {connect} from 'react-redux';
                Severity: Minor
                Found in src/client/submissions/pages/submissions.tsx - About 2 hrs to fix

                  Function highchartSolvedProblems has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  let highchartSolvedProblems = (user: User, userStats: any, rankingStartDate: string) => {
                  let rankingStartDateParts = rankingStartDate.split('-');
                  let solvedProblemsCountPerDay = [
                  [Date.UTC(Number(rankingStartDateParts[0]), Number(rankingStartDateParts[1]) - 1, Number(rankingStartDateParts[2])), 0]
                  ];
                  Severity: Major
                  Found in src/client/users/components/UserStats.tsx - About 2 hrs to fix

                    Function statusFormatter has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    static statusFormatter(cell: StatusCode) {
                    let status;
                    let style;
                    let icon;
                    switch (cell) {
                    Severity: Minor
                    Found in src/client/submissions/pages/submissions.tsx - About 1 hr to fix

                      Function findErrorsInSignupForm has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      static findErrorsInSignupForm(formData: SignupForm, emailRegex: string, emailErrorMessage: string) {
                       
                      let newState = Object.assign({}, initialFormState);
                       
                      if (formData.username === "") {
                      Severity: Minor
                      Found in src/client/users/pages/signup.tsx - About 1 hr to fix

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

                        render() {
                        if (this.props.auth.user) {
                        return <Redirect to={{
                        pathname: "/profile/" + this.props.auth.user.username,
                        state: { from: this.props.location }
                        Severity: Minor
                        Found in src/client/users/pages/login.tsx - About 1 hr to fix

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

                          export function auth(state: AuthState = defaultStartState, action: AuthAction) {
                          switch (action.type) {
                          case types.LOGIN_SUCCESS:
                          return {...state,
                          user: action.user,
                          Severity: Minor
                          Found in src/client/users/reducers/index.ts - About 1 hr to fix

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

                            render() {
                            const {ranking, previousRanking} = this.props;
                             
                            let rankingData = new RankingWithChange(ranking, previousRanking)
                            .calculate();
                            Severity: Minor
                            Found in src/client/ranking/pages/userRanking.tsx - About 1 hr to fix

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

                              .map((problem, idx) => {
                               
                              let acceptedSubmissions = submissions.filter(
                              (submission: Submission) => submission.statusCode === 'ACCEPTED'
                              );
                              Severity: Minor
                              Found in src/client/problems/pages/problems.tsx - About 1 hr to fix

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

                                const ProblemDetails = (props: ProblemProps) => {
                                 
                                const checkControl = props.isSuccess
                                ? <FontAwesome prefix="fas" name="check"/>
                                : props.isFailure
                                Severity: Minor
                                Found in src/client/problems/components/ProblemDetails.tsx - About 1 hr to fix

                                  Function ProblemRank has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const ProblemRank = (props: ProblemRankProps) => {
                                  let ranking = props.problemRanking.map ? props.problemRanking : [];
                                   
                                  let rankingData = ranking.map((ranking, idx) =>
                                  ({...ranking, idx: idx + 1})
                                  Severity: Minor
                                  Found in src/client/problems/components/ProblemRank.tsx - About 1 hr to fix

                                    Function websocketInit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function websocketInit() {
                                    let socket = new SockJS('/ws/events-websocket');
                                     
                                    let stompClient = Stomp.over(socket);
                                     
                                     
                                    Severity: Minor
                                    Found in src/client/common/actions/index.ts - About 1 hr to fix

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

                                      export const TeamRankingTable = (props: TeamRankingTableProps) => {
                                      let teams = _.groupBy(props.ranking, 'team');
                                      let teamsRank = _.orderBy(_.map(teams, (rankNodes, team) => {
                                      return {team: team, score: _.sumBy(rankNodes, 'score'), size: rankNodes.length};
                                      }), ['score'], ['desc']);
                                      Severity: Minor
                                      Found in src/client/ranking/components/TeamRankingTable.tsx - About 1 hr to fix

                                        Function ProblemTitle has 28 lines of code (exceeds 25 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 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language