neuropsychology/NeuroKit

View on GitHub
neurokit2/ecg/ecg_findpeaks.py

Summary

Maintainability
A
0 mins
Test Coverage

File ecg_findpeaks.py has 733 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

                        for missed_peak in missed_peaks:
                            if missed_peak - peaks[idx[-2]] > int(0.360 * sampling_rate) and ma[missed_peak] > 0.5 * th:
                                QRS.append(missed_peak)
                                QRS.sort()
                                break
    Severity: Major
    Found in neurokit2/ecg/ecg_findpeaks.py - About 45 mins 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

                            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

            There are no issues that match your filters.

            Category
            Status