Completed
Pull Request — master (#3)
by Yang
04:29
created

Python.DICOM.test_anonymize   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A UT_DICOMAnonymization.test_folder() 0 17 3
1
import unittest
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...
2
from tempfile import TemporaryDirectory
3
from DICOM.anonymize import DICOM_anonymize
0 ignored issues
show
introduced by
Unable to import 'DICOM.anonymize'
Loading history...
4
from shutil import copyfile
0 ignored issues
show
introduced by
standard import "from shutil import copyfile" should be placed before "from DICOM.anonymize import DICOM_anonymize"
Loading history...
5
import os
0 ignored issues
show
introduced by
standard import "import os" should be placed before "from DICOM.anonymize import DICOM_anonymize"
Loading history...
6
7
class UT_DICOMAnonymization(unittest.TestCase):
0 ignored issues
show
Coding Style Naming introduced by
The name UT_DICOMAnonymization 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...
8
9
    @staticmethod
10
    def test_folder():
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...
11
        from pydicom.data import get_testdata_files
12
13
        # Make Temporary Folder
14
        files = get_testdata_files("[mM][rR][iI]")
15
16
        # Copy files to Temporary Folder
17
        with TemporaryDirectory() as temp_folder:
18
19
            # Copy all files
20
            for file in files:
21
                path, fileName = os.path.split(file)
0 ignored issues
show
Coding Style Naming introduced by
The name fileName 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...
Unused Code introduced by
The variable path seems to be unused.
Loading history...
22
                copyfile(file, os.path.join(temp_folder, fileName))
23
24
            # Anonymize that folder.
25
            DICOM_anonymize.folder(temp_folder, "NEW_CONTESTANT")
26
0 ignored issues
show
coding-style introduced by
Trailing newlines
Loading history...
27