dsi-icl/optimise

View on GitHub

Showing 380 of 1,390 total issues

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

    static _checkEntryOrder(pregnancyEntry, data) {
        let pregnancyId = pregnancyEntry.pregnancyId;
        const currentVisit = data.visits.find(el => parseInt(el.id) === parseInt(pregnancyEntry.recordedDuringVisit));

        const allPregnancyEntries = data.pregnancyEntries.filter((el) => parseInt(el.pregnancyId) === parseInt(pregnancyId));

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

        render() {
            return (
                <>
                    <div className={style.ariane}>
                        <Helmet title='Patient Search' />
    Severity: Minor
    Found in packages/optimise-ui/src/components/searchPatient/searchPatient.jsx - About 1 hr to fix

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

      export const formatEdss = (edssList, typeTable) => {
          if (edssList.length === 0) {
              return () => [
                  blockgen(''),
                  blockgen(edssTitle(), [{ offset: 0, length: 11, style: 'BOLD' }]),

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

            _handleSubmit(ev) {
                ev.preventDefault();
                if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
                    return;
        

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

              static async getMeddraField({ query }, res) {
                  const result = [];
                  const maxOccurency = 20;
                  await MeddraController.loadMeddraCollection();
                  if (query.hasOwnProperty('search')) {
          Severity: Minor
          Found in packages/optimise-core/src/controllers/meddraController.js - About 1 hr to fix

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

                static editTreatment({ body, user }, res) {
                    if (body.hasOwnProperty('id') && typeof body.id === 'number') {
            
                        const momentStart = moment(body.startDate, moment.ISO_8601);
                        const momentTerminated = moment(body.terminatedDate, moment.ISO_8601);
            Severity: Minor
            Found in packages/optimise-core/src/controllers/treatmentController.js - About 1 hr to fix

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

                  static createImmunisation({ body, user }, res) {
                      if (body.hasOwnProperty('patient') && body.hasOwnProperty('immunisationDate') && body.hasOwnProperty('vaccineName') &&
                          typeof body.patient === 'number' && typeof body.immunisationDate === 'string' && typeof body.vaccineName === 'string') {
                          const momentImmun = moment(body.immunisationDate, moment.ISO_8601);
                          if (!momentImmun.isValid() && body.immunisationDate !== null) {
              Severity: Minor
              Found in packages/optimise-core/src/controllers/demographicDataController.js - About 1 hr to fix

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

                    getVisits(patientId, deleted) {
                        const _this = this;
                        const whereObj = { 'VISITS.patient': patientId };
                        if (deleted !== true)
                            whereObj['VISITS.deleted'] = '-';
                Severity: Minor
                Found in packages/optimise-core/src/utils/selector-utils.js - About 1 hr to fix

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

                      static async getICD11Field({ query }, res) {
                          const result = [];
                          const maxOccurency = 20;
                          await ICD11Controller.loadICD11Collection();
                          if (query.hasOwnProperty('search')) {
                  Severity: Minor
                  Found in packages/optimise-core/src/controllers/icd11Controller.js - About 1 hr to fix

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

                        render() {
                            const { yesOrNoQuestion } = this.props;
                            return <Switch>
                                <Route
                                    path='/patientProfile/:patientId/visitFrontPage/:visitId/page/:currentPage/yes_or_no'

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

                          render() {
                              const { yesOrNoQuestion } = this.props;
                              return <Switch>
                                  <Route
                                      path='/patientProfile/:patientId/visitFrontPage/:visitId/page/:currentPage/yes_or_no'

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

                            render() {
                                const { yesOrNoQuestion } = this.props;
                                return <Switch>
                                    <Route
                                        path='/patientProfile/:patientId/visitFrontPage/:visitId/page/:currentPage/yes_or_no'

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

                              render() {
                          
                                  if (!this.props.data.visits)
                                      return null;
                          
                          
                          Severity: Minor
                          Found in packages/optimise-ui/src/components/patientProfile/patientChart.jsx - About 1 hr to fix

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

                                _handleSubmitClick(ev) {
                                    ev.preventDefault();
                                    if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
                                        return;
                                    if (!this.state.startDate

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

                                  _handleSubmit(ev) {
                                      ev.preventDefault();
                                      if (this.state.lastSubmit && (new Date()).getTime() - this.state.lastSubmit < 500 ? true : false)
                                          return;
                              

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

                                    static updateTest({ body, user }, res) {
                                        if (!body.hasOwnProperty('id')) {
                                            res.status(400).json(ErrorHelper(message.userError.MISSINGARGUMENT));
                                            return;
                                        }
                                Severity: Minor
                                Found in packages/optimise-core/src/controllers/testController.js - About 1 hr to fix

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

                                      static createPregnancyImage({ body, user }, res) {
                                  
                                          if (!body.hasOwnProperty('visitId') || !body.hasOwnProperty('date') || !body.hasOwnProperty('mode') || !body.hasOwnProperty('result')) {
                                              res.status(400).json(ErrorHelper(message.userError.MISSINGARGUMENT));
                                              return;
                                  Severity: Minor
                                  Found in packages/optimise-core/src/controllers/demographicDataController.js - About 1 hr to fix

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

                                            const fetchAssociatedDataForCEandTransform = async data => {
                                                let entry;
                                                let typeMap;
                                                const associatedData = await dbcon()('CLINICAL_EVENTS_DATA').select('*').where('deleted', '-').where('clinicalEvent', data.id);
                                                switch (data.type) {
                                    Severity: Minor
                                    Found in packages/optimise-core/src/controllers/exportDataController.js - About 1 hr to fix

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

                                          static updateCe({ body, user }, res) {
                                              if (!body.hasOwnProperty('id')) {
                                                  res.status(400).json(ErrorHelper(message.userError.MISSINGARGUMENT));
                                                  return;
                                              }
                                      Severity: Minor
                                      Found in packages/optimise-core/src/controllers/ceController.js - About 1 hr to fix

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

                                            render() {
                                                const { yesOrNoQuestion } = this.props;
                                        
                                                return <Switch>
                                                    <Route
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language