< Summary

Class:ProfanityWordProviderFromCsv
Assembly:ProfanityFiltering
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/ProfanityFiltering/ProfanityWordProviderFromCsv.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:26
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ProfanityWordProviderFromCsv(...)0%2100%
GetExplicitWords()0%2100%
GetNonExplicitWords()0%2100%
Load(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/ProfanityFiltering/ProfanityWordProviderFromCsv.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5public class ProfanityWordProviderFromCsv : IProfanityWordProvider
 6{
 7    private readonly string explicitCsvFilePath;
 8    private readonly string nonExplicitCsvFilePath;
 9
 010    public ProfanityWordProviderFromCsv(string explicitCsvFilePath,
 11        string nonExplicitCsvFilePath)
 12    {
 013        this.explicitCsvFilePath = explicitCsvFilePath;
 014        this.nonExplicitCsvFilePath = nonExplicitCsvFilePath;
 015    }
 16
 017    public IEnumerable<string> GetExplicitWords() => Load(explicitCsvFilePath);
 18
 019    public IEnumerable<string> GetNonExplicitWords() => Load(nonExplicitCsvFilePath);
 20
 21    private IEnumerable<string> Load(string csvFilePath)
 22    {
 023        var asset = Resources.Load<TextAsset>(csvFilePath);
 024        return asset.text.Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries);
 25    }
 26}