datalad/datalad-neuroimaging

View on GitHub
datalad_neuroimaging/extractors/bids.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function _get_cnmeta has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_cnmeta(self, bids):
        # TODO any custom handling of participants infos should eventually
        # be done by pybids in one way or another
        path_props = {}
        participants_fname = opj(self.ds.path, 'participants.tsv')
Severity: Minor
Found in datalad_neuroimaging/extractors/bids.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

Function yield_participant_info has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

def yield_participant_info(bids):
    for bidsvars in bids.get_collections(
            level='dataset')[0].to_df().to_dict(orient='records'):
        props = dict(id=assure_unicode(bidsvars.pop('subject')))
        for p in bidsvars:
Severity: Minor
Found in datalad_neuroimaging/extractors/bids.py - About 2 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

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

    def _get_dsmeta(self, bids):
        context = {}
        if hasattr(bids, 'get_dataset_description'):
            # post 0.9.1
            # https://github.com/bids-standard/pybids/pull/444
Severity: Minor
Found in datalad_neuroimaging/extractors/bids.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