fastest.file_handler.read_file   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A read_file() 0 11 2
1
import os
2
3
4
def read_file(dir_path, file_path):
5
    """
6
    Read contents of a .py file and return as text
7
    :param dir_path: str
8
    :param file_path: str
9
    :return: str
10
    """
11
    goal_dir = os.path.join(dir_path, file_path)
12
    with open(os.path.abspath(goal_dir), 'r') as fp:
13
        contents = fp.read()
14
    return contents
15