• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Courseography / courseography / c8b24422-58d7-45d0-809d-004c312d821e

18 Jul 2026 02:16AM UTC coverage: 58.657% (-0.6%) from 59.228%
c8b24422-58d7-45d0-809d-004c312d821e

push

circleci

web-flow
Switched Haskell formatter to fourmolu and ran on all files (#1763)

517 of 966 branches covered (53.52%)

Branch coverage included in aggregate %.

851 of 1590 new or added lines in 34 files covered. (53.52%)

84 existing lines in 13 files now uncovered.

2522 of 4215 relevant lines covered (59.83%)

154.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

67.44
/app/DynamicGraphs/GraphOptions.hs
1
module DynamicGraphs.GraphOptions where
2

3
import Data.Aeson (FromJSON (parseJSON), withObject, (.!=), (.:?))
4
import qualified Data.Text.Lazy as T
5

6
data GraphOptions
7
    = GraphOptions
8
    { taken :: [T.Text] -- courses to exclude from graph
63✔
9
    , departments :: [T.Text] -- department prefixes to include
152✔
NEW
10
    , excludedDepth :: Int -- depth to recurse on courses from excluded departments
×
NEW
11
    , maxDepth :: Int -- total recursive depth to recurse on (depth of the overall graph)
×
12
    , courseNumPrefix :: [Int] -- filter based on course number (most useful for filtering based on year)
7✔
13
    , distribution :: [T.Text] -- distribution to include: like "artsci", or "engineering"
7✔
14
    , location :: [T.Text] -- location of courses to include: like "utsg", or "utsc"
71✔
NEW
15
    , includeRaws :: Bool -- True to include nodes which are raw values
×
NEW
16
    , includeGrades :: Bool -- True to include grade nodes
×
17
    }
18
    deriving Show
19

20
data CourseGraphOptions = CourseGraphOptions {courses :: [T.Text], programs :: [T.Text], graphOptions :: GraphOptions}
35✔
21
    deriving Show
22

23
defaultGraphOptions :: GraphOptions
24
defaultGraphOptions =
NEW
25
    GraphOptions
×
NEW
26
        [] -- taken
×
NEW
27
        [] -- departments
×
NEW
28
        0 -- excludedDepth
×
NEW
29
        (-1) -- maxDepth
×
NEW
30
        [] -- courseNumPrefix
×
NEW
31
        [] -- distribution
×
NEW
32
        [] -- location
×
NEW
33
        True -- includeRaws
×
NEW
34
        True -- includeGrades
×
35

36
instance FromJSON CourseGraphOptions where
37
    parseJSON = withObject "Expected Object for GraphOptions" $ \o -> do
7✔
38
        rootCourses <- o .:? "courses" .!= []
7✔
39
        rootPrograms <- o .:? "programs" .!= []
7✔
40
        takenCourses <- o .:? "taken" .!= []
7✔
41
        dept <- o .:? "departments" .!= []
7✔
42
        excludedCourseDepth <- o .:? "excludedDepth" .!= 0
7✔
43
        maxGraphDepth <- o .:? "maxDepth" .!= (-1)
7✔
44
        courseNumPref <- o .:? "courseNumPrefix" .!= []
7✔
45
        distrib <- o .:? "distribution" .!= []
7✔
46
        includedLocation <- o .:? "location" .!= []
7✔
47
        incRaws <- o .:? "includeRaws" .!= True
7✔
48
        incGrades <- o .:? "includeGrades" .!= True
7✔
49
        let options =
50
                GraphOptions
7✔
51
                    takenCourses
7✔
52
                    dept
7✔
53
                    excludedCourseDepth
7✔
54
                    maxGraphDepth
7✔
55
                    courseNumPref
7✔
56
                    distrib
7✔
57
                    includedLocation
7✔
58
                    incRaws
7✔
59
                    incGrades
7✔
60
        return $ CourseGraphOptions rootCourses rootPrograms options
7✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc