< Summary

Information
Class: MusicTheory.Theory.Interval.FunctionalInterval
Assembly: MusicTheory
File(s): /home/runner/work/MusicTheory/MusicTheory/Theory/Interval/IntervalTypes.cs
Line coverage
52%
Covered lines: 9
Uncovered lines: 8
Coverable lines: 17
Total lines: 63
Line coverage: 52.9%
Branch coverage
41%
Covered branches: 5
Total branches: 12
Branch coverage: 41.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Type()100%11100%
get_Semitones()100%11100%
get_Function()100%210%
.ctor(...)100%11100%
get_DisplayName()41.66%491236.36%

File(s)

/home/runner/work/MusicTheory/MusicTheory/Theory/Interval/IntervalTypes.cs

#LineLine coverage
 1using System;
 2
 3namespace MusicTheory.Theory.Interval
 4{
 5    public enum IntervalType
 6    {
 7        PerfectUnison = 0,
 8        MinorSecond = 1,
 9        MajorSecond = 2,
 10        MinorThird = 3,
 11        MajorThird = 4,
 12        PerfectFourth = 5,
 13        Tritone = 6,
 14        PerfectFifth = 7,
 15        MinorSixth = 8,
 16        MajorSixth = 9,
 17        MinorSeventh = 10,
 18        MajorSeventh = 11,
 19        Octave = 12,
 20        MinorNinth = 13,
 21        MajorNinth = 14,
 22        AugmentedNinth = 15,
 23        PerfectEleventh = 17,
 24        AugmentedEleventh = 18,
 25        MinorThirteenth = 20,
 26        MajorThirteenth = 21
 27    }
 28
 29    public enum TensionFunction
 30    {
 31        None,
 32        Modal,
 33        Avoid,
 34        Altered,
 35        LeadingTone,
 36        Suspensive,
 37        ChromaticColor
 38    }
 39
 40    // 新名称クラス (今後はこちらを使用)
 41    public readonly record struct FunctionalInterval
 42    {
 103843        public IntervalType Type { get; }
 103444        public int Semitones => (int)Type;
 045        public TensionFunction Function { get; }
 46        public FunctionalInterval(IntervalType type, TensionFunction function = TensionFunction.None)
 47        {
 6748            Type = type;
 6749            Function = function;
 6750        }
 251        public string DisplayName => Type switch
 252        {
 053            IntervalType.MinorSecond => "♭9",
 054            IntervalType.MajorSecond => "9",
 055            IntervalType.AugmentedNinth => "♯9",
 056            IntervalType.PerfectEleventh => "11",
 057            IntervalType.AugmentedEleventh => "♯11",
 058            IntervalType.MinorThirteenth => "♭13",
 059            IntervalType.MajorThirteenth => "13",
 260            _ => Type.ToString()
 261        };
 62    }
 63}