< Summary

Information
Class: MusicTheory.Theory.Pitch.PitchClass
Assembly: MusicTheory
File(s): /home/runner/work/MusicTheory/MusicTheory/Theory/Pitch/PitchClass.cs
Line coverage
60%
Covered lines: 3
Uncovered lines: 2
Coverable lines: 5
Total lines: 20
Line coverage: 60%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Value()100%11100%
get_Pc()100%11100%
FromMidi(...)100%210%
op_Addition(...)100%210%
ToString()100%11100%

File(s)

/home/runner/work/MusicTheory/MusicTheory/Theory/Pitch/PitchClass.cs

#LineLine coverage
 1namespace MusicTheory.Theory.Pitch
 2{
 3
 4    // 等音(pc)
 2285    public readonly record struct PitchClass(int Value)
 6{
 2287    public int Pc => ((Value % 12) + 12) % 12;
 08    public static PitchClass FromMidi(int midi) => new(midi % 12);
 09    public static PitchClass operator +(PitchClass a, int semitones) => new(a.Pc + semitones);
 210    public override string ToString() => Pc.ToString("00");
 11}
 12
 13
 14    // 絶対音(綴り+オクターブ)
 15    public readonly record struct Pitch(SpelledPitch Spelling, int Octave)
 16    {
 17        public override string ToString() => $"{Spelling}{Octave}";
 18    }
 19
 20}