wongjiahau/ttap-web

View on GitHub

Showing 125 of 211 total issues

Function ReactGridLayout has 254 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ReactGridLayout = function (_React$Component) {
  _inherits(ReactGridLayout, _React$Component);

  // TODO publish internal ReactClass displayName transform
  function ReactGridLayout(props, context) {

    Function GridItem has 223 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var GridItem = function (_React$Component) {
      _inherits(GridItem, _React$Component);
    
      function GridItem() {
        var _temp, _this, _ret;
    Severity: Major
    Found in src/ts/modified_node_modules/react-grid-layout/build/GridItem.js - About 1 day to fix

      Function FindTimetable has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

      export function FindTimetable(
        input: IOptimizedSlot[],
        disableClashChecking = false,
        visualizer?: FindTimetableVisualizer<IOptimizedSlot>
      ): Timetable[] {
      Severity: Minor
      Found in src/ts/permutator/findTimetable.ts - About 7 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 render has 172 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public render() {
          const {
            slot,
            color,
            isShowingAlternativeSlot,
      Severity: Major
      Found in src/ts/react/slotView.tsx - About 6 hrs to fix

        Function ReactGridLayout has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

        var ReactGridLayout = function (_React$Component) {
          _inherits(ReactGridLayout, _React$Component);
        
          // TODO publish internal ReactClass displayName transform
          function ReactGridLayout(props, context) {

        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 127 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public render() {
            if (this.state.loading) {
              return getLoadingElement();
            }
            if (this.state.redirect) {
        Severity: Major
        Found in src/ts/react/login.tsx - About 5 hrs to fix

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

            public render() {
              return (
                <Drawer
                  anchor="right"
                  open={this.props.isOpen}
          Severity: Major
          Found in src/ts/react/slotsTableView.tsx - About 5 hrs to fix

            File ReactGridLayout.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            //@ts-nocheck
            'use strict';
            
            exports.__esModule = true;
            
            

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

                public render() {
                  const subjectViews = this.props.Subjects.map((s, index) => {
                    if (s.IsVisible) {
                      return (
                        <div key={s.Code}>
              Severity: Major
              Found in src/ts/react/subjectListView.tsx - About 4 hrs to fix

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

                  public render() {
                    return (
                      <Dialog open={this.props.isOpen} fullScreen={true}>
                        {/* transition={Transition}> */}
                        <DialogContent style={divStyle}>
                Severity: Major
                Found in src/ts/react/setTimeConstraintView.tsx - About 4 hrs to fix

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

                    public render() {
                      // const DEBUGGING = false; // Please change to false during production
                      // if (DEBUGGING) {
                      //     this.props.handleSlotLoaded(HENG_2017_APR());
                      //     alert("WARNING! You are in a debugging session.");
                  Severity: Major
                  Found in src/ts/react/timetableCreatorView.tsx - About 3 hrs to fix

                    Function FindTimetable has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function FindTimetable(
                      input: IOptimizedSlot[],
                      disableClashChecking = false,
                      visualizer?: FindTimetableVisualizer<IOptimizedSlot>
                    ): Timetable[] {
                    Severity: Major
                    Found in src/ts/permutator/findTimetable.ts - About 3 hrs to fix

                      Function GenerateNewState has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        protected GenerateNewState(state: IMasterState): IMasterState {
                          const currentTimetable =
                            state.TimetableListState.FiltrateTimetables[
                              state.TimetableListState.CurrentIndex
                            ];
                      Severity: Major
                      Found in src/ts/redux/actions/findAlternativeSlotsOfCurrentSlots.ts - About 3 hrs to fix

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

                          public render() {
                            if (!this.props.slotViewModelStore) {
                              return Logo();
                            }
                            const slotsToBeRendered =
                        Severity: Major
                        Found in src/ts/react/timetableListView.tsx - About 3 hrs to fix

                          Function GenerateTotalMatrix has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function GenerateTotalMatrix(
                            timetables: IGroupedTimetable[],
                            uidsOfClickedMatrix: string[] = []
                          ): STCBox[] {
                            const result = new Array<STCBox>();
                          Severity: Minor
                          Found in src/ts/model/matrix/generateTotalMatrix.ts - About 3 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 ParseStudentHtmlToRawSlot_v2 has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function ParseStudentHtmlToRawSlot_v2(html: string): RawSlot[] {
                            const result = new Array<RawSlot>();
                            const htmlDoc = new DOMParser().parseFromString(html, "text/html");
                            // @ts-ignore
                            const tableRows = Array.from(
                          Severity: Major
                          Found in src/ts/parser/parseStudentHtmlToRawSlot_v2.ts - About 3 hrs to fix

                            File utils.js has 306 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            //@ts-nocheck
                            'use strict';
                            
                            exports.__esModule = true;
                            
                            
                            Severity: Minor
                            Found in src/ts/modified_node_modules/react-grid-layout/build/utils.js - About 3 hrs to fix

                              Function ParseStudentHtmlToRawSlot has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function ParseStudentHtmlToRawSlot(html: string): RawSlot[] {
                                const result = new Array<RawSlot>();
                                const htmlDoc = new DOMParser().parseFromString(html, "text/html");
                                // @ts-ignore
                                const tableRows = htmlDoc
                              Severity: Major
                              Found in src/ts/parser/parseStudentHtmlToRawSlot.ts - About 3 hrs to fix

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

                                  public render() {
                                    const getButton = (
                                      handler: any,
                                      icon: any,
                                      tooltip: string,
                                Severity: Major
                                Found in src/ts/react/counterView.tsx - About 3 hrs to fix

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

                                  export function ParseFgoHtmlToRawSlot_v2(html: string): RawSlot[] {
                                    const result = new Array<RawSlot>();
                                    const htmlDoc = new DOMParser().parseFromString(html, "text/html");
                                  
                                    const tableRows = htmlDoc
                                  Severity: Major
                                  Found in src/ts/parser/parseFgoHtmlToRawSlot_v2.ts - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language