forked from kowainik/stan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stan.html
61 lines (60 loc) · 67.3 KB
/
stan.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE HTML>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description" content="Stan Report"><meta name="keywords" content="Haskell, Static Analysis"><meta name="author" content="Kowainik"><title>Stan Report</title><style>html,body{height:100%;width:100%;margin:0% 0% 0% 0%;padding:0% 0% 0% 0%;left:0%;top:0%;font-family:sans-serif;font-size:100%;color:#616161;line-height:1.5}h1{font-size:2.5rem}h2{font-size:2rem}h3{font-size:1.375rem}h4{font-size:1.125rem}h5{font-size:1rem}h6{font-size:0.875rem}p{font-size:1.125rem;font-weight:200;line-height:1.8}.centre{text-align:center;margin-left:auto;margin-right:auto}.container{width:90%;margin-left:auto;margin-right:auto}.row{position:relative;width:100%}.row [class^='col']{float:left;margin-top:0.5rem;margin-bottom:0.5rem;margin-left:2%;margin-right:2%;min-height:0.125rem}.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12{width:96%}.col-1-sm{width:4.33%}.col-2-sm{width:12.66%}.col-3-sm{width:21%}.col-4-sm{width:29.32999%}.col-5-sm{width:37.65999%}.col-6-sm{width:46%}.col-7-sm{width:54.32999%}.col-8-sm{width:62.65999%}.col-9-sm{width:71%}.col-10-sm{width:79.32999%}.col-11-sm{width:87.65999%}.col-12-sm{width:96%}.row::after{content:"";display:table;clear:both}.hidden-sm{display:none}.grey-bg{background-color:#616161;color:#ffffff}.very-light-bg{background-color:#f1f1f1}main{margin-left:auto;margin-right:auto}nav{background-color:#616161;color:#ffff00;padding:1% 0% 1% 0%}a{text-decoration:none;color:#ffff00}a[href]{text-decoration:underline}a[href]:hover{font-weight:bold}footer,header{display:block;text-align:center;width:100%;max-width:100%;background-color:#bdbdbd;border-top:15px solid #616161}footer{margin-top:2%}footer > .container{margin-top:20px;margin-bottom:20px}.footer-link a:hover{font-weight:normal;text-decoration:none}.ins-link{text-decoration:none !important;padding:2px 10px 2px 10px;background-color:#616161;color:#ffffff}.ins-link:hover{color:#616161;background-color:rgba(0,0,0,0.0)}pre,code{background-color:#4e342e;color:#ffffff;padding:1px 2px 1px 2px}pre{margin-top:2%;margin-bottom:2%;margin-left:10%;margin-right:10%;padding:2% 2% 2% 2%;overflow-x:auto}.solutions{margin-top:1%;margin-bottom:1%;margin-left:10%;margin-right:10%;padding:1% 1% 1% 1%;background-color:rgba(255,246,143,0.4);border-radius:4px 4px 4px 4px !important}.solutions ul,.config-warnings ul{list-style-type:none}.solutions li::before{content:"💡"}.config-warnings li::before{content:"⚙️"}table{width:100%;border-radius:4px 4px 4px 4px !important;border-collapse:collapse}th:first-child{border-radius:4px 0px 0px 0px}th:last-child{border-radius:0px 4px 0px 0px}td,th{padding:0 8px 0 8px}.observation tr,.observation td,.observation th,#configurations tr,#configurations td,#configurations th,#stan-info tr,#stan-info td,#stan-info th,#severity tr,#severity td,#severity th{border:1px solid #bdbdbd}.border-shadow{-webkit-box-shadow:0px 0px 4px 4px rgba(97,97,97,0.3);-moz-box-shadow:0px 0px 4px 4px rgba(97,97,97,0.3);-ms-box-shadow:0px 0px 4px 4px rgba(97,97,97,0.3);-o-box-shadow:0px 0px 4px 4px rgba(97,97,97,0.3);box-shadow:0px 0px 4px 4px rgba(97,97,97,0.3);border-style:hidden}.info-name{font-style:italic}.info-data{font-weight:bold}#stan-info table{margin-left:auto;margin-right:auto}blockquote{padding-left:2%;border-left:4px solid #616161;-webkit-box-shadow:-4px 0px #bdbdbd;-moz-box-shadow:-4px 0px #bdbdbd;-ms-box-shadow:-4px 0px #bdbdbd;-o-box-shadow:-4px 0px #bdbdbd;box-shadow:-4px 0px #bdbdbd}.obs-li{margin:0% 0% 0% 0% !important}#file > h3{padding-left:5px}#file > ul{list-style-type:none}.cats{list-style-type:none;overflow:hidden;padding:0% 0% 0% 0%}.inline{display:inline}.cats > li{float:left}td > .cats > li{margin-top:2px;margin-bottom:2px}.cat{background-color:#ffc0cb;border-radius:3px 0px 0px 3px;display:inline-block;padding:0px 20px 0px 23px;text-decoration:none;position:relative;transition-property:color;transition-duration:0.2s}.cat::before{background-color:#ffffff;border-radius:10px 10px 10px 10px;-webkit-box-shadow:inset 0px 1px rgba(0,0,0,0.25);-moz-box-shadow:inset 0px 1px rgba(0,0,0,0.25);-ms-box-shadow:inset 0px 1px rgba(0,0,0,0.25);-o-box-shadow:inset 0px 1px rgba(0,0,0,0.25);box-shadow:inset 0px 1px rgba(0,0,0,0.25);content:"";height:6px;left:10px;position:absolute;width:6px;top:10px}.cat::after{background-color:#f1f1f1;border-bottom:13px solid rgba(0,0,0,0.0);border-left:10px solid #ffc0cb;border-top:13px solid rgba(0,0,0,0.0);content:"";position:absolute;right:0%;top:0%}.inline > .cat::after{background-color:#ffffff}.severity{display:inline-block;padding:1px 0px 0px 0px;border:1px solid #616161;border-radius:4px 4px 4px 4px;line-height:1}.severityText{padding:0px 15px 0px 15px}.severityStyle{padding:0px 15px 0px 15px;height:100%;background-color:#00ffff;background-clip:padding-box;border-radius:4px 0px 0px 4px;border-right:1px solid #616161}.severityPerformance{padding:0px 15px 0px 15px;height:100%;background-color:#0000ff;background-clip:padding-box;border-radius:4px 0px 0px 4px;border-right:1px solid #616161}.severityPotentialBug{padding:0px 15px 0px 15px;height:100%;background-color:#ff00ff;background-clip:padding-box;border-radius:4px 0px 0px 4px;border-right:1px solid #616161}.severityWarning{padding:0px 15px 0px 15px;height:100%;background-color:#ffff00;background-clip:padding-box;border-radius:4px 0px 0px 4px;border-right:1px solid #616161}.severityError{padding:0px 15px 0px 15px;height:100%;background-color:#ff0000;background-clip:padding-box;border-radius:4px 0px 0px 4px;border-right:1px solid #616161}.remove{color:#000000;background-color:rgba(255,0,0,0.5)}.include{color:#000000;background-color:rgba(0,128,0,0.5)}.exclude{color:#000000;background-color:rgba(255,255,0,0.5)}.ignore{color:#000000;background-color:rgba(255,165,0,0.5)}.sum{display:block;clear:both;position:relative}.sum::before{content:"";width:4rem;height:4rem;float:left;margin:0px 1.5rem 0.75rem 0px;background-image:-webkit-linear-gradient(to bottom right,#616161 25%,#f1f1f1 100%);background-image:-moz-linear-gradient(to bottom right,#616161 25%,#f1f1f1 100%);background-image:-ms-linear-gradient(to bottom right,#616161 25%,#f1f1f1 100%);background-image:-o-linear-gradient(to bottom right,#616161 25%,#f1f1f1 100%);background-image:linear-gradient(to bottom right,#616161 25%,#f1f1f1 100%);text-shadow:0px 0px 2px #616161;border-radius:50% 50% 50% 50%;display:inline-flex;align-items:center;justify-content:center;shape-outside:ellipse();z-index:1}.sum::after{width:2rem;height:2rem;position:absolute;top:0px;left:0px;content:"";background-color:#616161;z-index:-1;border-top-left-radius:3px 3px}.collapsible{width:100%;font-size:1.125rem;margin-left:0% !important;margin-bottom:0% !important;margin-right:0% !important;background-color:#616161;color:#ffffff;cursor:pointer;text-align:left}.active,.collapsible:hover{background-color:#bdbdbd}.collapsible::after{content:"\002B";color:#ffffff;font-weight:bold;float:right;margin-left:5px}.active::after{content:"\2212"}.content{max-height:0;overflow:hidden;transition-property:max-height;transition-timing-function:ease-out;transition-duration:0.2s;background-color:#f1f1f1}.content > div{padding:0px 0px 0px 18px}@media screen and (min-width: 33.75em){.container{width:80%}}@media screen and (min-width: 45em){.col-1{width:4.33%}.col-2{width:12.66%}.col-3{width:21%}.col-4{width:29.32999%}.col-5{width:37.65999%}.col-6{width:46%}.col-7{width:54.32999%}.col-8{width:62.65999%}.col-9{width:71%}.col-10{width:79.32999%}.col-11{width:87.65999%}.col-12{width:96%}}@media screen and (min-width: 60em){.container{width:75%;max-width:60rem}}</style></head><body><header class="centre"><div class="row"><h1>Stan Report</h1></div><nav class="row"><div class="col-3 nav-item"><a href="#general-info">General Info</a></div><div class="col-3 nav-item"><a href="#observations">Observations</a></div><div class="col-3 nav-item"><a href="#configurations">Configurations</a></div><div class="col-3 nav-item"><a href="#report-explained">Report Explained</a></div></nav></header><main class="container"><div class="row"><p>This is the Haskell Static Analysis report generated by <a href="https://kowainik.github.io/projects/stan" class="ins-link">Stan</a></p></div><div id="stan-info" class="row"><h2>Stan Info</h2><div class="row"><blockquote><p>In this section, you can find the general information about the used Stan tool, compile-time and run-time environment variables and settings, including build information, system data and execution configurations.</p></blockquote></div><div class="col-10"><table class="border-shadow" style="table-layout:fixed"><colgroup><col style="width:25%"><col></colgroup><tr><td colspan="2" class="centre grey-bg"><strong>Stan Version</strong></td></tr><tr><td class="info-name">Version</td><td class="info-data very-light-bg">0.1.0.1</td></tr><tr><td class="info-name">Git Revision</td><td class="info-data very-light-bg">b01a3ace51dbaa8525417349cf5a8017b73ed495</td></tr><tr><td class="info-name">Release Date</td><td class="info-data very-light-bg">Mon Oct 16 18:36:18 2023 +0100</td></tr><tr><td colspan="2" class="centre grey-bg"><strong>System Info</strong></td></tr><tr><td class="info-name">Operating System</td><td class="info-data very-light-bg">linux</td></tr><tr><td class="info-name">Architecture</td><td class="info-data very-light-bg">x86_64</td></tr><tr><td class="info-name">Compiler</td><td class="info-data very-light-bg">ghc</td></tr><tr><td class="info-name">Compiler Version</td><td class="info-data very-light-bg">8.10</td></tr><tr><td colspan="2" class="centre grey-bg"><strong>Environment</strong></td></tr><tr><td class="info-name">Environment Variables</td><td class="info-data very-light-bg"></td></tr><tr><td class="info-name">TOML configuration files</td><td class="info-data very-light-bg">/home/tom/Haskell/stan/.stan.toml</td></tr><tr><td class="info-name">CLI arguments</td><td class="info-data very-light-bg">check --exclude --filter-all --directory=test/ check --exclude --filter-all --directory=src/ check --include --filter-all --file=src/Stan/Example.hs check --exclude --id=STAN-0103 --scope-all check --exclude --id=STAN-0001 --file=src/MyFile.hs ignore --id=OBS-00001 ignore --id=OBS-STAN-0212-emMVqk-114:21 report</td></tr></table></div></div><div id="general-info" class="row"><div id="project-info" class="col-6"><h2>Project Info</h2><div class="row"><blockquote><p>Information about the analysed project</p></blockquote></div><table class="border-shadow "><colgroup><col class="info-name"><col class="info-data"></colgroup><tr><td class="info-name">Project name</td><td class="info-data very-light-bg">stan</td></tr><tr><td class="info-name">Cabal Files</td><td class="info-data very-light-bg">stan.cabal</td></tr><tr><td class="info-name">HIE Files Directory</td><td class="info-data very-light-bg">.hie</td></tr><tr><td class="info-name">Files Number</td><td class="info-data very-light-bg">76</td></tr></table></div><div id="analysis-info" class="col-6"><h2>Analysis Info</h2><div class="row"><blockquote><p>Summary stats from the static analysis</p></blockquote></div><table class="border-shadow "><tr><td class="info-name">Modules</td><td class="info-data very-light-bg">67</td></tr><tr><td class="info-name">LoC</td><td class="info-data very-light-bg">8405</td></tr><tr><td class="info-name">Extensions</td><td class="info-data very-light-bg">29</td></tr><tr><td class="info-name">SafeHaskell Extensions</td><td class="info-data very-light-bg">0</td></tr><tr><td class="info-name">Available inspections</td><td class="info-data very-light-bg">44</td></tr><tr><td class="info-name">Checked inspections</td><td class="info-data very-light-bg">43</td></tr><tr><td class="info-name">Found Observations</td><td class="info-data very-light-bg">14</td></tr><tr><td class="info-name">Ignored Observations</td><td class="info-data very-light-bg">0</td></tr></table></div></div><div id="static-analysis-summary" class="row"><h2>Static Analysis Summary</h2><div class="row"><blockquote><p>Here you can find the overall conclusion based on the various metadata and gathered information during the work of Stan on this project.</p></blockquote></div><ul class="col-10"><li class="sum"><h4>Project health: 69.77%</h4><span>This number was calculated based on the total number of used inspections and the number of triggered inspections in the project. The calculated number also defines the overall project health status.</span></li><li class="sum"><h4>The project has low health</h4><span>According to the Stan analysis, the project has issues of a different variety. But you can improve that! Stan provides solutions to the observed problems to help you improve the code quality.</span></li><li class="sum"><h4>Watch out for STAN-0302</h4><span>By the result of Stan analysis, the most common inspection for this project is <a class="ins-link" href="#STAN-0302">STAN-0302</a></span></li><li class="sum"><h4>Vulnerable module: Stan.Example</h4><span>The <code>Stan.Example</code> module is the most vulnerable one in the project, as it got the most number of observations</span></li><li class="sum"><h4>Popular category: AntiPattern</h4><ul class="cats inline"><li class="cat">AntiPattern</li></ul>The project has the most problems with inspections from this category</li><li class="sum"><h4>Severity: Error</h4>The highest severity of found observations is <span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></li></ul></div><div id="observations" class="row"><h2>Observations</h2><div class="row"><blockquote><p>Based on the analysis results, Stan found several areas for improvement in the analysed files. In Stan terminology, we call these findings Observations. Below you can see the more detailed information about each observation, and find the possible ways to fix them for your project.</p></blockquote></div><ul><li><span><a class="ins-link" href="#Paths_stan">Paths_stan</a></span></li><li><span><a class="ins-link" href="#Stan.Example">Stan.Example</a></span></li></ul><div id="file" class="row"><h3 class="grey-bg" id="Paths_stan">📄 /home/tom/Haskell/stan/dist-newstyle/build/x86_64-linux/ghc-8.10.7/stan-0.1.0.1/build/autogen/Paths_stan.hs</h3><ul><li><table class="border-shadow col-6"><tr><td class="info-name">Module</td><td class="info-data very-light-bg"><code>Paths_stan</code></td></tr><tr><td class="info-name">Lines of Code</td><td class="info-data very-light-bg">74</td></tr></table></li><li><div class="extensions"><div class="col-6"><button class="collapsible">Extensions from .cabal</button><ol class="content"><li>Unable to extract extensions</li></ol></div><div class="col-6"><button class="collapsible">Extensions from module</button><ol class="content"><li>CPP</li><li>NoRebindableSyntax</li></ol></div></div></li><li class="col-12 obs-li"><div class="observations col-12"><h4>Observations</h4><div id="OBS-STAN-0004-jWdzZV-67:22" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0004-jWdzZV-67:22</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of partial function 'last' for lists</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0004">STAN-0004</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">Partial</li><li class="cat">List</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">/home/tom/Haskell/stan/dist-newstyle/build/x86_64-linux/ghc-8.10.7/stan-0.1.0.1/build/autogen/Paths_stan.hs</td></tr></table></div><pre> 66 ┃
67 ┃ | isPathSeparator (List.last dir) = dir ++ fname
68 ┃ ^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div></div></li></ul></div><div id="file" class="row"><h3 class="grey-bg" id="Stan.Example">📄 src/Stan/Example.hs</h3><ul><li><table class="border-shadow col-6"><tr><td class="info-name">Module</td><td class="info-data very-light-bg"><code>Stan.Example</code></td></tr><tr><td class="info-name">Lines of Code</td><td class="info-data very-light-bg">63</td></tr></table></li><li><div class="extensions"><div class="col-6"><button class="collapsible">Extensions from .cabal</button><ol class="content"><li>ConstraintKinds</li><li>DeriveGeneric</li><li>DerivingStrategies</li><li>GeneralizedNewtypeDeriving</li><li>InstanceSigs</li><li>KindSignatures</li><li>LambdaCase</li><li>OverloadedStrings</li><li>RecordWildCards</li><li>ScopedTypeVariables</li><li>StandaloneDeriving</li><li>TupleSections</li><li>TypeApplications</li><li>ViewPatterns</li></ol></div><div class="col-6"><button class="collapsible">Extensions from module</button><ol class="content"><li>NoUndecidableInstances</li><li>PatternSynonyms</li></ol></div></div></li><li class="col-12 obs-li"><div class="observations col-12"><h4>Observations</h4><div id="OBS-STAN-0211-saA9eI-25:21" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0211-saA9eI-25:21</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of '</>' for URLs results in the errors on Windows</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0211">STAN-0211</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 24 ┃
25 ┃ mkMyUrlPart myUrl = myUrl </> "asd"
26 ┃ ^^^^^^^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Use type-safe library for URLs</li><li>Concatenate URLs with slashes '/'</li></ul></div></div><div id="OBS-STAN-0207-saA9eI-28:14" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0207-saA9eI-28:14</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of Foldable methods on (,), Maybe, Either</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0207">STAN-0207</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 27 ┃
28 ┃ pairLength = length ((1, 2) :: (Int, Int))
29 ┃ ^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Use more explicit functions with specific monomorphic types</li></ul></div></div><div id="OBS-STAN-0201-saA9eI-31:16" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0201-saA9eI-31:16</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Creating a list with wrong number of indices</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0201">STAN-0201</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 30 ┃
31 ┃ listIndxs xs = [0 .. length xs]
32 ┃ ^^^^^^^^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace '[0 .. length xs]' with '[0 .. length xs - 1]'</li><li>Use 'zip [0 ..] xs` to work with list of pairs: index and element</li></ul></div></div><div id="OBS-STAN-0203-saA9eI-34:16" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0203-saA9eI-34:16</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of 'pack' function that doesn't handle Unicode characters</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0203">STAN-0203</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 33 ┃
34 ┃ toByteString = BS8.pack
35 ┃ ^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Convert to 'Text' and use 'encodeUtf8' from 'Data.Text.Encoding'</li><li>{Extra dependency} Use 'encodeUtf8' from 'relude'</li><li>{Extra dependency} Use the 'utf8-string' package</li></ul></div></div><div id="OBS-STAN-0215-saA9eI-37:13" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0215-saA9eI-37:13</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of '/' or '\' in paths results in the errors on different operation systems</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0215">STAN-0215</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 36 ┃
37 ┃ pathToX x = "src/lib" </> x
38 ┃ ^^^^^^^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Use '</>' operator from 'filepath'</li></ul></div></div><div id="OBS-STAN-0001-saA9eI-40:20" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0001-saA9eI-40:20</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of partial function 'head' for lists</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0001">STAN-0001</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">Partial</li><li class="cat">List</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 39 ┃
40 ┃ getFirstIPromise = P.head
41 ┃ ^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div><div id="OBS-STAN-0009-saA9eI-43:12" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0009-saA9eI-43:12</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of partial function 'read' for parsing 'String'</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0009">STAN-0009</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">Partial</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 42 ┃
43 ┃ parseInt = P.read
44 ┃ ^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Use 'readMaybe' or 'readEither' to handle failed parsing</li></ul></div></div><div id="OBS-STAN-0302-saA9eI-45:16" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0302-saA9eI-45:16</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityStyle"></span><span class="severityText">Style</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Using tuples of big size (>= 4) can decrease code readability</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0302">STAN-0302</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li><li class="cat">Syntax</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 44 ┃
45 ┃ quad :: Int -> (Int, Int, Int, Int)
46 ┃ ^^^^^^^^^^^^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Consider defining and using a custom data type to improve code comprehension</li></ul></div></div><div id="OBS-STAN-0302-saA9eI-46:10" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0302-saA9eI-46:10</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityStyle"></span><span class="severityText">Style</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Using tuples of big size (>= 4) can decrease code readability</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0302">STAN-0302</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li><li class="cat">Syntax</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 45 ┃
46 ┃ quad x = (x, x, x, x)
47 ┃ ^^^^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Consider defining and using a custom data type to improve code comprehension</li></ul></div></div><div id="OBS-STAN-0301-saA9eI-48:1" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0301-saA9eI-48:1</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityStyle"></span><span class="severityText">Style</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Using the implicit default fixity for operator: infixl 9</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0301">STAN-0301</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">Syntax</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 47 ┃
48 ┃ (?+?) :: Int -> Int -> Int
49 ┃ ^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Add 'infix[l|r]' declaration to the operator with explicit precedence</li></ul></div></div><div id="OBS-STAN-0214-saA9eI-52:1" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0214-saA9eI-52:1</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Usage of multiple comparison operators instead of single 'compare'</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0214">STAN-0214</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 51 ┃
52 ┃ isEq x y
53 ┃ | x < y = False
54 ┃ | x > y = False
55 ┃ | otherwise = True
56 ┃ ^^^^^^^^^^^^^^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Rewrite code to use single 'compare' instead of many comparison operators</li></ul></div></div><div id="OBS-STAN-0213-saA9eI-58:37" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0213-saA9eI-58:37</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Pattern matching on '_' for sum types can create maintainability issues</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0213">STAN-0213</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">AntiPattern</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 57 ┃
58 ┃ prettyOrdering = \case {GT -> "GT"; _ -> "LT"}
59 ┃ ^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Pattern match on each constructor explicitly</li><li>Add meaningful names to holes, e.g. '_anyOtherFailure'</li></ul></div></div><div id="OBS-STAN-0206-saA9eI-62:7" class="observation row"><div class="observation-general"><table class="border-shadow "><tr><td class="info-name very-light-bg">ID</td><td class="info-data">OBS-STAN-0206-saA9eI-62:7</td></tr><tr><td class="info-name very-light-bg">Severity</td><td class="info-data"><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></td></tr><tr><td class="info-name very-light-bg">Description</td><td class="info-data">Defining lazy fields in data types can lead to unexpected space leaks</td></tr><tr><td class="info-name very-light-bg">Inspection ID</td><td class="info-data"><a class="ins-link" href="#STAN-0206">STAN-0206</a></td></tr><tr><td class="info-name very-light-bg">Category</td><td class="info-data"><ul class="cats inline"><li class="cat">SpaceLeak</li><li class="cat">Syntax</li></ul></td></tr><tr><td class="info-name very-light-bg">File</td><td class="info-data">src/Stan/Example.hs</td></tr></table></div><pre> 61 ┃
62 ┃ , userAge :: Int
63 ┃ ^^^^^^^^^^^^^^^
</pre><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Add '!' before the type, e.g. !Int or !(Maybe Bool)</li><li>Enable the 'StrictData' extension: {-# LANGUAGE StrictData #-}</li></ul></div></div></div></li></ul></div></div><div id="configurations" class="row"><h2>Configurations</h2><div class="col-12"><div class="row"><blockquote><p>This section describes the final Stan configuration that was used on the project and explains how this result was assembled. Stan runtime settings have many parts, and each of them can come from different configuration sources. Stan is using Environment variables, TOML configuration file and CLI arguments to get the final results. If some option is specified through the multiple sources, the most prioritized one is used. </p></blockquote></div><div class="row"><table><tr><th>Action</th><th>Filter</th><th>Scope</th></tr><tr class="remove"><td class="centre"><span><strong>— Remove </strong></span></td><td></td><td>Directory: target/</td></tr><tr class="exclude"><td class="centre"><span><strong>∩ Exclude</strong></span></td><td>All inspections</td><td>Directory: test/</td></tr><tr class="exclude"><td class="centre"><span><strong>∩ Exclude</strong></span></td><td>All inspections</td><td>Directory: src/</td></tr><tr class="include"><td class="centre"><span><strong>∪ Include</strong></span></td><td>All inspections</td><td>File: src/Stan/Example.hs</td></tr><tr class="exclude"><td class="centre"><span><strong>∩ Exclude</strong></span></td><td>ID: STAN-0103</td><td>All files</td></tr><tr class="exclude"><td class="centre"><span><strong>∩ Exclude</strong></span></td><td>ID: STAN-0001</td><td>File: src/MyFile.hs</td></tr><tr class="ignore"><td class="centre"><span><strong>✖ Ignore </strong></span></td><td>OBS-00001</td><td></td></tr><tr class="ignore"><td class="centre"><span><strong>✖ Ignore </strong></span></td><td>OBS-STAN-0212-emMVqk-114:21</td><td></td></tr></table></div><div class="ignored-observations row"><div class="ignored-obs"><h4>Unrecognised Observations</h4><p>Some observation IDs specified in the configurations are not found</p><ul><li>OBS-00001</li><li>OBS-STAN-0212-emMVqk-114:21</li></ul></div></div><div class="config-warnings row"><h4>Configuration Process Information</h4><p>Information and warnings that were gathered during the configuration assemble process. This helps to understand how different parts of the configurations were retrieved.</p><ul><li>configChecks is set through the source: CLI</li><li>No CLI option specified for: remove</li><li>configRemoved is set through the source: TOML</li><li>No TOML value is specified for key: ignore</li><li>configIgnored is set through the source: CLI</li></ul></div></div></div><div id="report-explained" class=""><h2>Report Explained</h2><div id="inspections" class="row"><h2>Inspections</h2><div class="row"><blockquote><p>List of Inspections used for analysing the project</p></blockquote></div><div><button class="collapsible" id="STAN-0001">Explore Inspection STAN-0001</button><div class="content row"><div id="STAN-0001-content" class="inspection col-12"><h3>Inspection STAN-0001</h3><p><strong>Partial: base/head</strong></p><p><em>Usage of partial function 'head' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div></div><button class="collapsible" id="STAN-0002">Explore Inspection STAN-0002</button><div class="content row"><div id="STAN-0002-content" class="inspection col-12"><h3>Inspection STAN-0002</h3><p><strong>Partial: base/tail</strong></p><p><em>Usage of partial function 'tail' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div></div><button class="collapsible" id="STAN-0003">Explore Inspection STAN-0003</button><div class="content row"><div id="STAN-0003-content" class="inspection col-12"><h3>Inspection STAN-0003</h3><p><strong>Partial: base/init</strong></p><p><em>Usage of partial function 'init' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div></div><button class="collapsible" id="STAN-0004">Explore Inspection STAN-0004</button><div class="content row"><div id="STAN-0004-content" class="inspection col-12"><h3>Inspection STAN-0004</h3><p><strong>Partial: base/last</strong></p><p><em>Usage of partial function 'last' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div></div><button class="collapsible" id="STAN-0005">Explore Inspection STAN-0005</button><div class="content row"><div id="STAN-0005-content" class="inspection col-12"><h3>Inspection STAN-0005</h3><p><strong>Partial: base/!!</strong></p><p><em>Usage of partial function '!!' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div></div></div><button class="collapsible" id="STAN-0006">Explore Inspection STAN-0006</button><div class="content row"><div id="STAN-0006-content" class="inspection col-12"><h3>Inspection STAN-0006</h3><p><strong>Partial: base/cycle</strong></p><p><em>Usage of partial function 'cycle' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div></div><button class="collapsible" id="STAN-0007">Explore Inspection STAN-0007</button><div class="content row"><div id="STAN-0007-content" class="inspection col-12"><h3>Inspection STAN-0007</h3><p><strong>Partial: base/genericIndex</strong></p><p><em>Usage of partial function 'genericIndex' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div></div></div><button class="collapsible" id="STAN-0008">Explore Inspection STAN-0008</button><div class="content row"><div id="STAN-0008-content" class="inspection col-12"><h3>Inspection STAN-0008</h3><p><strong>Partial: base/fromJust</strong></p><p><em>Usage of partial function 'fromJust' for 'Maybe'</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Use explicit pattern-matching over Maybe</li><li>Use one of the standard functions: 'maybe', 'fromMaybe'</li></ul></div></div></div><button class="collapsible" id="STAN-0009">Explore Inspection STAN-0009</button><div class="content row"><div id="STAN-0009-content" class="inspection col-12"><h3>Inspection STAN-0009</h3><p><strong>Partial: base/read</strong></p><p><em>Usage of partial function 'read' for parsing 'String'</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Use 'readMaybe' or 'readEither' to handle failed parsing</li></ul></div></div></div><button class="collapsible" id="STAN-0010">Explore Inspection STAN-0010</button><div class="content row"><div id="STAN-0010-content" class="inspection col-12"><h3>Inspection STAN-0010</h3><p><strong>Partial: base/succ</strong></p><p><em>Usage of partial function 'succ' for enumerable types</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Use '(+ 1)' for integral types (but be aware of arithmetic overflow)</li><li>{Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'</li></ul></div></div></div><button class="collapsible" id="STAN-0011">Explore Inspection STAN-0011</button><div class="content row"><div id="STAN-0011-content" class="inspection col-12"><h3>Inspection STAN-0011</h3><p><strong>Partial: base/pred</strong></p><p><em>Usage of partial function 'pred' for enumerable types</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Use '(- 1)' for integral types (but be aware of arithmetic overflow)</li><li>{Extra dependency} Use 'prev' from 'Relude.Extra.Enum' in 'relude'</li></ul></div></div></div><button class="collapsible" id="STAN-0012">Explore Inspection STAN-0012</button><div class="content row"><div id="STAN-0012-content" class="inspection col-12"><h3>Inspection STAN-0012</h3><p><strong>Partial: base/toEnum</strong></p><p><em>Usage of partial function 'toEnum' for enumerable types</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Use 'safeToEnum' from 'Relude.Extra.Enum' in 'relude'</li></ul></div></div></div><button class="collapsible" id="STAN-0013">Explore Inspection STAN-0013</button><div class="content row"><div id="STAN-0013-content" class="inspection col-12"><h3>Inspection STAN-0013</h3><p><strong>Partial: base/maximum</strong></p><p><em>Usage of partial function 'maximum' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0014">Explore Inspection STAN-0014</button><div class="content row"><div id="STAN-0014-content" class="inspection col-12"><h3>Inspection STAN-0014</h3><p><strong>Partial: base/minimum</strong></p><p><em>Usage of partial function 'minimum' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0015">Explore Inspection STAN-0015</button><div class="content row"><div id="STAN-0015-content" class="inspection col-12"><h3>Inspection STAN-0015</h3><p><strong>Partial: base/maximumBy</strong></p><p><em>Usage of partial function 'maximumBy' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0016">Explore Inspection STAN-0016</button><div class="content row"><div id="STAN-0016-content" class="inspection col-12"><h3>Inspection STAN-0016</h3><p><strong>Partial: base/minimumBy</strong></p><p><em>Usage of partial function 'minimumBy' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0017">Explore Inspection STAN-0017</button><div class="content row"><div id="STAN-0017-content" class="inspection col-12"><h3>Inspection STAN-0017</h3><p><strong>Partial: base/foldl1</strong></p><p><em>Usage of partial function 'foldl1' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0018">Explore Inspection STAN-0018</button><div class="content row"><div id="STAN-0018-content" class="inspection col-12"><h3>Inspection STAN-0018</h3><p><strong>Partial: base/foldl1'</strong></p><p><em>Usage of partial function 'foldl1'' for lists</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace list with 'NonEmpty' from 'Data.List.NonEmpty'</li><li>Use explicit pattern-matching over lists</li></ul></div></div></div><button class="collapsible" id="STAN-0019">Explore Inspection STAN-0019</button><div class="content row"><div id="STAN-0019-content" class="inspection col-12"><h3>Inspection STAN-0019</h3><p><strong>Partial: base/foldr1</strong></p><p><em>Usage of partial function 'foldr1' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0020">Explore Inspection STAN-0020</button><div class="content row"><div id="STAN-0020-content" class="inspection col-12"><h3>Inspection STAN-0020</h3><p><strong>Partial: base/fromList</strong></p><p><em>Usage of partial function 'fromList' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0021">Explore Inspection STAN-0021</button><div class="content row"><div id="STAN-0021-content" class="inspection col-12"><h3>Inspection STAN-0021</h3><p><strong>Partial: base/fromInteger</strong></p><p><em>Usage of partial function 'fromInteger' for </em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">Partial</li></ul></div></div></div><button class="collapsible" id="STAN-0101">Explore Inspection STAN-0101</button><div class="content row"><div id="STAN-0101-content" class="inspection col-12"><h3>Inspection STAN-0101</h3><p><strong>Infinite: base/reverse</strong></p><p><em>Usage of the 'reverse' function that hangs on infinite lists</em></p><div><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></div><div><ul class="cats "><li class="cat">Infinite</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Don't use 'reverse' if you expect your function to work with infinite lists</li><li>{Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists</li></ul></div></div></div><button class="collapsible" id="STAN-0102">Explore Inspection STAN-0102</button><div class="content row"><div id="STAN-0102-content" class="inspection col-12"><h3>Inspection STAN-0102</h3><p><strong>Infinite: base/isSuffixOf</strong></p><p><em>Usage of the 'isSuffixOf' function that hangs on infinite lists</em></p><div><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></div><div><ul class="cats "><li class="cat">Infinite</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Don't use 'isSuffixOf' if you expect your function to work with infinite lists</li><li>{Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists</li></ul></div></div></div><button class="collapsible" id="STAN-0104">Explore Inspection STAN-0104</button><div class="content row"><div id="STAN-0104-content" class="inspection col-12"><h3>Inspection STAN-0104</h3><p><strong>Infinite: base/genericLength</strong></p><p><em>Usage of the 'genericLength' function that hangs on infinite lists</em></p><div><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></div><div><ul class="cats "><li class="cat">Infinite</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Don't use 'genericLength' if you expect your function to work with infinite lists</li><li>{Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists</li></ul></div></div></div><button class="collapsible" id="STAN-0105">Explore Inspection STAN-0105</button><div class="content row"><div id="STAN-0105-content" class="inspection col-12"><h3>Inspection STAN-0105</h3><p><strong>Infinite: base/sum</strong></p><p><em>Usage of the 'sum' function that hangs on infinite lists</em></p><div><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></div><div><ul class="cats "><li class="cat">Infinite</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Don't use 'sum' if you expect your function to work with infinite lists</li><li>{Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists</li></ul></div></div></div><button class="collapsible" id="STAN-0106">Explore Inspection STAN-0106</button><div class="content row"><div id="STAN-0106-content" class="inspection col-12"><h3>Inspection STAN-0106</h3><p><strong>Infinite: base/product</strong></p><p><em>Usage of the 'product' function that hangs on infinite lists</em></p><div><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></div><div><ul class="cats "><li class="cat">Infinite</li><li class="cat">List</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Don't use 'product' if you expect your function to work with infinite lists</li><li>{Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists</li></ul></div></div></div><button class="collapsible" id="STAN-0201">Explore Inspection STAN-0201</button><div class="content row"><div id="STAN-0201-content" class="inspection col-12"><h3>Inspection STAN-0201</h3><p><strong>Anti-pattern: [0 .. length xs]</strong></p><p><em>Creating a list with wrong number of indices</em></p><div><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace '[0 .. length xs]' with '[0 .. length xs - 1]'</li><li>Use 'zip [0 ..] xs` to work with list of pairs: index and element</li></ul></div></div></div><button class="collapsible" id="STAN-0202">Explore Inspection STAN-0202</button><div class="content row"><div id="STAN-0202-content" class="inspection col-12"><h3>Inspection STAN-0202</h3><p><strong>Anti-pattern: foldl</strong></p><p><em>Usage of space-leaking function 'foldl'</em></p><div><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></div><div><ul class="cats "><li class="cat">SpaceLeak</li><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Replace 'foldl' with 'foldl''</li><li>Use 'foldr (flip . f)` instead of 'foldl f'</li></ul></div></div></div><button class="collapsible" id="STAN-0203">Explore Inspection STAN-0203</button><div class="content row"><div id="STAN-0203-content" class="inspection col-12"><h3>Inspection STAN-0203</h3><p><strong>Anti-pattern: Data.ByteString.Char8.pack</strong></p><p><em>Usage of 'pack' function that doesn't handle Unicode characters</em></p><div><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Convert to 'Text' and use 'encodeUtf8' from 'Data.Text.Encoding'</li><li>{Extra dependency} Use 'encodeUtf8' from 'relude'</li><li>{Extra dependency} Use the 'utf8-string' package</li></ul></div></div></div><button class="collapsible" id="STAN-0204">Explore Inspection STAN-0204</button><div class="content row"><div id="STAN-0204-content" class="inspection col-12"><h3>Inspection STAN-0204</h3><p><strong>Anti-pattern: HashMap size</strong></p><p><em>Usage of 'size' or 'length' for 'HashMap' that runs in linear time</em></p><div><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Switch to 'Map' from 'containers'</li></ul></div></div></div><button class="collapsible" id="STAN-0205">Explore Inspection STAN-0205</button><div class="content row"><div id="STAN-0205-content" class="inspection col-12"><h3>Inspection STAN-0205</h3><p><strong>Anti-pattern: HashSet size</strong></p><p><em>Usage of 'size' or 'length' for 'HashSet' that runs in linear time</em></p><div><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Switch to 'Set' from 'containers'</li></ul></div></div></div><button class="collapsible" id="STAN-0206">Explore Inspection STAN-0206</button><div class="content row"><div id="STAN-0206-content" class="inspection col-12"><h3>Inspection STAN-0206</h3><p><strong>Data types with non-strict fields</strong></p><p><em>Defining lazy fields in data types can lead to unexpected space leaks</em></p><div><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></div><div><ul class="cats "><li class="cat">SpaceLeak</li><li class="cat">Syntax</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Add '!' before the type, e.g. !Int or !(Maybe Bool)</li><li>Enable the 'StrictData' extension: {-# LANGUAGE StrictData #-}</li></ul></div></div></div><button class="collapsible" id="STAN-0207">Explore Inspection STAN-0207</button><div class="content row"><div id="STAN-0207-content" class="inspection col-12"><h3>Inspection STAN-0207</h3><p><strong>Anti-pattern: Foldable methods on possibly error-prone structures</strong></p><p><em>Usage of Foldable methods on (,), Maybe, Either</em></p><div><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Use more explicit functions with specific monomorphic types</li></ul></div></div></div><button class="collapsible" id="STAN-0208">Explore Inspection STAN-0208</button><div class="content row"><div id="STAN-0208-content" class="inspection col-12"><h3>Inspection STAN-0208</h3><p><strong>Anti-pattern: Slow 'length' for Text</strong></p><p><em>Usage of 'length' for 'Text' that runs in linear time</em></p><div><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Switch to 'ByteString' from 'bytestring'</li></ul></div></div></div><button class="collapsible" id="STAN-0209">Explore Inspection STAN-0209</button><div class="content row"><div id="STAN-0209-content" class="inspection col-12"><h3>Inspection STAN-0209</h3><p><strong>Anti-pattern: Slow 'nub' for lists</strong></p><p><em>Usage of 'nub' on lists that runs in quadratic time</em></p><div><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Switch list to 'Set' from 'containers'</li><li>{Extra dependency} Use 'ordNub/hashNub/sortNub/unstableNub' from 'relude'</li><li>{Extra dependency} Use 'nubOrd' from 'containers'</li><li>{Extra dependency} Use 'nubOrd' from 'extra'</li></ul></div></div></div><button class="collapsible" id="STAN-0210">Explore Inspection STAN-0210</button><div class="content row"><div id="STAN-0210-content" class="inspection col-12"><h3>Inspection STAN-0210</h3><p><strong>Anti-pattern: Slow 'for_' on ranges</strong></p><p><em>Usage of 'for_' or 'forM_' on numerical ranges is slow</em></p><div><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Use 'loop' library for fast monadic looping</li></ul></div></div></div><button class="collapsible" id="STAN-0211">Explore Inspection STAN-0211</button><div class="content row"><div id="STAN-0211-content" class="inspection col-12"><h3>Inspection STAN-0211</h3><p><strong>Anti-pattern: '</>' for URLs</strong></p><p><em>Usage of '</>' for URLs results in the errors on Windows</em></p><div><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Use type-safe library for URLs</li><li>Concatenate URLs with slashes '/'</li></ul></div></div></div><button class="collapsible" id="STAN-0212">Explore Inspection STAN-0212</button><div class="content row"><div id="STAN-0212-content" class="inspection col-12"><h3>Inspection STAN-0212</h3><p><strong>Anti-pattern: unsafe functions</strong></p><p><em>Usage of unsafe functions breaks referential transparency</em></p><div><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></div><div><ul class="cats "><li class="cat">Unsafe</li><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Remove 'undefined' or at least replace with 'error' to give better error messages</li><li>Replace 'unsafeCoerce' with 'coerce'</li><li>Rewrite the code to avoid using 'unsafePerformIO' and other unsafe IO functions</li></ul></div></div></div><button class="collapsible" id="STAN-0213">Explore Inspection STAN-0213</button><div class="content row"><div id="STAN-0213-content" class="inspection col-12"><h3>Inspection STAN-0213</h3><p><strong>Anti-pattern: Pattern matching on '_'</strong></p><p><em>Pattern matching on '_' for sum types can create maintainability issues</em></p><div><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Pattern match on each constructor explicitly</li><li>Add meaningful names to holes, e.g. '_anyOtherFailure'</li></ul></div></div></div><button class="collapsible" id="STAN-0214">Explore Inspection STAN-0214</button><div class="content row"><div id="STAN-0214-content" class="inspection col-12"><h3>Inspection STAN-0214</h3><p><strong>Anti-pattern: use 'compare'</strong></p><p><em>Usage of multiple comparison operators instead of single 'compare'</em></p><div><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Rewrite code to use single 'compare' instead of many comparison operators</li></ul></div></div></div><button class="collapsible" id="STAN-0215">Explore Inspection STAN-0215</button><div class="content row"><div id="STAN-0215-content" class="inspection col-12"><h3>Inspection STAN-0215</h3><p><strong>Anti-pattern: Slashes in paths</strong></p><p><em>Usage of '/' or '\' in paths results in the errors on different operation systems</em></p><div><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>{Extra dependency} Use '</>' operator from 'filepath'</li></ul></div></div></div><button class="collapsible" id="STAN-0301">Explore Inspection STAN-0301</button><div class="content row"><div id="STAN-0301-content" class="inspection col-12"><h3>Inspection STAN-0301</h3><p><strong>Missing fixity declaration for operator</strong></p><p><em>Using the implicit default fixity for operator: infixl 9</em></p><div><span class="severity"><span class="severityStyle"></span><span class="severityText">Style</span></span></div><div><ul class="cats "><li class="cat">Syntax</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Add 'infix[l|r]' declaration to the operator with explicit precedence</li></ul></div></div></div><button class="collapsible" id="STAN-0302">Explore Inspection STAN-0302</button><div class="content row"><div id="STAN-0302-content" class="inspection col-12"><h3>Inspection STAN-0302</h3><p><strong>Big tuples</strong></p><p><em>Using tuples of big size (>= 4) can decrease code readability</em></p><div><span class="severity"><span class="severityStyle"></span><span class="severityText">Style</span></span></div><div><ul class="cats "><li class="cat">AntiPattern</li><li class="cat">Syntax</li></ul></div><div class="solutions border-shadow"><h4>Possible solutions</h4><ul><li>Consider defining and using a custom data type to improve code comprehension</li></ul></div></div></div></div></div><div id="severity" class="row"><h2>Severity</h2><div class="col-5"><blockquote><p>We are using the following severity system to indicate the observation level</p></blockquote></div><table class="border-shadow col-7"><tr class="grey-bg"><th>Severity</th><th>Description</th></tr><tr><td><span class="severity"><span class="severityStyle"></span><span class="severityText">Style</span></span></td><td>Code style issues. Usually harmless.</td></tr><tr><td><span class="severity"><span class="severityPerformance"></span><span class="severityText">Performance</span></span></td><td>Serious defects that could cause slowness and space leaking.</td></tr><tr><td><span class="severity"><span class="severityPotentialBug"></span><span class="severityText">PotentialBug</span></span></td><td>Human errors in code.</td></tr><tr><td><span class="severity"><span class="severityWarning"></span><span class="severityText">Warning</span></span></td><td>Potential runtime errors on some inputs.</td></tr><tr><td><span class="severity"><span class="severityError"></span><span class="severityText">Error</span></span></td><td>Dangerous behaviour.</td></tr></table></div></div></main><footer><div class="container"><div class="row footer-link"><span>This report was generated by </span><a href="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/kowainik/stan">Stan — Haskell Static Analysis Tool.</a></div><div class="row footer-link"><span>Stan is created and maintained by </span><a href="https://kowainik.github.io">Kowainik</a></div></div><nav class="row centre"><h3><strong>© Kowainik 2020</strong></h3></nav></footer><script>var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}
</script></body></html>