adam2392/eegio

View on GitHub

Showing 57 of 69 total issues

Function _pyedf_saveas_edf has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _pyedf_saveas_edf(
Severity: Major
Found in eegio/writers/saveas.py - About 1 hr to fix

    Function saveas_edf has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def saveas_edf(
    Severity: Major
    Found in eegio/writers/saveas.py - About 50 mins to fix

      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Major
      Found in eegio/base/objects/derivatives/result_object.py - About 50 mins to fix

        Function find_seizure_onset has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def find_seizure_onset(
        Severity: Major
        Found in eegio/base/utils/scrubber.py - About 50 mins to fix

          Function find_seizure_offset has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def find_seizure_offset(
          Severity: Major
          Found in eegio/base/utils/scrubber.py - About 50 mins to fix

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

                def saveas_fif(self, fpath, rawdata, info, bad_chans_list=[], montage: List = []):
            Severity: Minor
            Found in eegio/writers/saveas.py - About 45 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in eegio/loaders/bids/bidsio.py - About 45 mins to fix

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

                    def saveas_hdf(
                Severity: Minor
                Found in eegio/writers/saveas.py - About 45 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in eegio/loaders/bids/bidsio.py - About 45 mins to fix

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

                    def copy_object_attributes(
                    Severity: Minor
                    Found in eegio/base/utils/data_structures_utils.py - About 45 mins to fix

                      Function findtimewins has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def findtimewins(times, timepoints):
                          indices = []
                          for time in ensure_list(times):
                              if time == 0:
                                  indices.append(time)
                      Severity: Minor
                      Found in eegio/base/utils/data_structures_utils.py - About 45 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 _check_keys has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _check_keys(self, keys):
                              for key, possibilities in keys.items():
                                  if key in self.data.keys():
                                      if self.data[key] in possibilities:
                                          continue
                      Severity: Minor
                      Found in eegio/base/dataset_test/dataset_tester.py - About 45 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 formal_repr has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def formal_repr(instance, attr_dict, sort_dict_flag=False):
                          """ A formal string representation for an object.
                          :param attr_dict: dictionary attribute_name: attribute_value
                          :param instance:  Instance to read class name from it
                          """
                      Severity: Minor
                      Found in eegio/base/utils/data_structures_utils.py - About 45 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

                      Consider simplifying this complex logical expression.
                      Open

                                  if (
                                      isinstance(field1, str)
                                      or isinstance(field1, list)
                                      or isinstance(field1, dict)
                                      or (isinstance(field1, np.ndarray) and field1.dtype.kind in "OSU")
                      Severity: Major
                      Found in eegio/base/utils/data_structures_utils.py - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if (transpose is "horizontal" or "row" and shape[0] > shape[1]) or (
                                    transpose is "vertical" or "column" and shape[0] < shape[1]
                                ):
                                    shape = list(shape)
                                    temp = shape[1]
                        Severity: Major
                        Found in eegio/base/utils/data_structures_utils.py - About 40 mins to fix

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

                              def __init__(
                          Severity: Minor
                          Found in eegio/base/objects/electrodes/electrode.py - About 35 mins to fix

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

                                def __init__(
                            Severity: Minor
                            Found in eegio/loaders/bids/bidsio.py - About 35 mins to fix

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

                                  def add_participants_field(
                              Severity: Minor
                              Found in eegio/loaders/bids/bids_patient.py - About 35 mins to fix

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

                                    def merge_npy_arrays(
                                Severity: Minor
                                Found in eegio/writers/saveas.py - About 35 mins to fix

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

                                      def __init__(
                                  Severity: Minor
                                  Found in eegio/base/objects/electrodes/elecs.py - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language