Passed
Pull Request — master (#2)
by Yang
02:09
created

Python.LORIS.test_LORIS_timepoint   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 12
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_visit_number_extraction() 0 14 4
1
from LORIS.timepoint import visit_number_extraction
0 ignored issues
show
Coding Style Naming introduced by
The name test_LORIS_timepoint does not conform to the module naming conventions ((([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
introduced by
Unable to import 'LORIS.timepoint'
Loading history...
2
3
def test_visit_number_extraction():
0 ignored issues
show
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
4
    Prefix = "V"
0 ignored issues
show
Coding Style Naming introduced by
The name Prefix does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
5
    numbers = [1, 2, 3, 9]
6
7
    global timepoints
0 ignored issues
show
Bug introduced by
Global variable 'timepoints' undefined at the module level
Loading history...
Coding Style Naming introduced by
The name timepoints does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
8
    timepoints = []
9
10
    for number in numbers:
11
        timepoints.append(Prefix + str(number))
12
13
    DualList = zip(numbers, timepoints)
0 ignored issues
show
Coding Style Naming introduced by
The name DualList does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
14
15
    for tuple in DualList:
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in tuple.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
16
        assert str(tuple[0]) == visit_number_extraction(tuple[1])[0]
17
18
    # todo: 10+ visit number WILL FAIL!
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...