neuropsychology/NeuroKit

View on GitHub
neurokit2/ecg/ecg_findpeaks.py

Summary

Maintainability
A
0 mins
Test Coverage

File ecg_findpeaks.py has 748 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

# - * - coding: utf-8 - * -
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.signal
Severity: Major
Found in neurokit2/ecg/ecg_findpeaks.py - About 1 day to fix

    Avoid deeply nested control flow statements.
    Wontfix

                        if detection - QRS[-1] > int(0.3 * sampling_rate):
                            QRS.append(detection)
                    else:
    Severity: Major
    Found in neurokit2/ecg/ecg_findpeaks.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Wontfix

                          for missed_peak in missed_peaks:
                              if (
                                  missed_peak - peaks[idx[-2]] > int(0.36 * sampling_rate)
                                  and ma[missed_peak] > 0.5 * th
                              ):
      Severity: Major
      Found in neurokit2/ecg/ecg_findpeaks.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Wontfix

                            if len(RR) > 8:
                                RR.pop(0)
                            RR_ave = int(np.mean(RR))
        Severity: Major
        Found in neurokit2/ecg/ecg_findpeaks.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Invalid

                              if len(missed_peaks) > 0:
                                  signal_peaks[-1] = missed_peaks[np.argmax(detection[missed_peaks])]
                                  signal_peaks.append(peak)
          
          
          Severity: Major
          Found in neurokit2/ecg/ecg_findpeaks.py - About 45 mins to fix

            Avoid too many return statements within this function.
            Wontfix

                    return _ecg_findpeaks_WT
            Severity: Major
            Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Wontfix

                      return _ecg_findpeaks_promac
              Severity: Major
              Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Wontfix

                        return _ecg_findpeaks_kalidas
                Severity: Major
                Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Wontfix

                          return _ecg_findpeaks_christov
                  Severity: Major
                  Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Wontfix

                            return _ecg_findpeaks_hamilton
                    Severity: Major
                    Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Wontfix

                              return _ecg_findpeaks_engzee
                      Severity: Major
                      Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Wontfix

                                return _ecg_findpeaks_elgendi
                        Severity: Major
                        Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Wontfix

                                  return _ecg_findpeaks_rodrigues
                          Severity: Major
                          Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Wontfix

                                    return _ecg_findpeaks_ssf
                            Severity: Major
                            Found in neurokit2/ecg/ecg_findpeaks.py - About 30 mins to fix

                              There are no issues that match your filters.

                              Category
                              Status