Passed
Pull Request — master (#3)
by Yang
04:58
created

Python.LORIS.test_timepoint   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A UT_LORISTimepoint.test_visit_number_extraction() 0 15 3
1
from LORIS.timepoint import LORIS_timepoint
0 ignored issues
show
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
import unittest
0 ignored issues
show
introduced by
standard import "import unittest" should be placed before "from LORIS.timepoint import LORIS_timepoint"
Loading history...
3
4
class UT_LORISTimepoint(unittest.TestCase):
0 ignored issues
show
Coding Style Naming introduced by
The name UT_LORISTimepoint does not conform to the class naming conventions ([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 class 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...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
5
6
    @staticmethod
7
    def test_visit_number_extraction():
0 ignored issues
show
Coding Style introduced by
This method 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...
8
        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...
9
        numbers = [1, 2, 3, 9]
10
11
        global timepoints
0 ignored issues
show
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...
Bug introduced by
Global variable 'timepoints' undefined at the module level
Loading history...
12
        timepoints = []
13
14
        for number in numbers:
15
            timepoints.append(Prefix + str(number))
16
17
        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...
18
19
        for tupleItem in DualList:
0 ignored issues
show
Coding Style Naming introduced by
The name tupleItem 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...
20
            assert str(tupleItem[0]) == LORIS_timepoint.visit_number_extraction(tupleItem[1])[0]
21
22
        # todo: 10+ visit number WILL FAIL!
0 ignored issues
show
Coding Style introduced by
Final newline missing
Loading history...