neuropsychology/NeuroKit.py

View on GitHub
neurokit/eeg/eeg_data.py

Summary

Maintainability
C
1 day
Test Coverage

Function eeg_select_electrodes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def eeg_select_electrodes(eeg, include="all", exclude=None, hemisphere="both", central=True):
    """
    Returns electrodes/sensors names of selected region (according to a 10-20 EEG montage).

    Parameters
Severity: Minor
Found in neurokit/eeg/eeg_data.py - 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

File eeg_data.py has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Loading data and events submodule.
"""
from ..signal import find_events

Severity: Minor
Found in neurokit/eeg/eeg_data.py - About 2 hrs to fix

    Function eeg_add_channel has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def eeg_add_channel(raw, channel, sync_index_eeg=0, sync_index_channel=0, channel_type=None, channel_name=None):
        """
        Add a channel to a mne's Raw m/eeg file. It will basically synchronize the channel to the eeg data following a particular index and add it.
    
        Parameters
    Severity: Minor
    Found in neurokit/eeg/eeg_data.py - About 1 hr 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 eeg_add_events has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def eeg_add_events(raw, events_channel, conditions=None, treshold="auto", cut="higher", time_index=None, number="all", after=0, before=None, min_duration=1):
    Severity: Major
    Found in neurokit/eeg/eeg_data.py - About 1 hr to fix

      Function eeg_to_all_evokeds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def eeg_to_all_evokeds(all_epochs, conditions=None):
          """
          Convert all_epochs to all_evokeds.
      
          DOCS INCOMPLETE :(
      Severity: Minor
      Found in neurokit/eeg/eeg_data.py - About 55 mins 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 eeg_add_channel has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def eeg_add_channel(raw, channel, sync_index_eeg=0, sync_index_channel=0, channel_type=None, channel_name=None):
      Severity: Minor
      Found in neurokit/eeg/eeg_data.py - About 45 mins to fix

        Function eeg_to_df has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def eeg_to_df(eeg, index=None, include="all", exclude=None, hemisphere="both", central=True):
        Severity: Minor
        Found in neurokit/eeg/eeg_data.py - About 45 mins to fix

          Function eeg_select_electrodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def eeg_select_electrodes(eeg, include="all", exclude=None, hemisphere="both", central=True):
          Severity: Minor
          Found in neurokit/eeg/eeg_data.py - About 35 mins to fix

            Function eeg_to_df has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def eeg_to_df(eeg, index=None, include="all", exclude=None, hemisphere="both", central=True):
                """
                Convert mne Raw or Epochs object to dataframe or dict of dataframes.
            
                DOCS INCOMPLETE :(
            Severity: Minor
            Found in neurokit/eeg/eeg_data.py - About 25 mins 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

            There are no issues that match your filters.

            Category
            Status