INNER CODE UNIT · Python

is_excluded_dir

AsPJT/PAX_SAPIENTICA · Scripts/CodeCounter.py:7

def is_excluded_dir(dirpath):
    for excluded in EXCLUDED_DIRS:
        if excluded in dirpath.split(os.sep):
            return True
    return False

def count_code_lines(filename):
    with open(filename, 'r') as file:
        lines = file.readlines()

    code_line_count = 0
    multi_line_comment = False
    for line in lines:
        line = line.strip()
        if line.startswith('/*'):
            multi_line_comment = True

        if not multi_line_comment and not line.startswith('//') and line != '':

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…