This is the Haskell Static Analysis report generated by Stan
Stan Info
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.
| Stan Version | |
| Version | 0.1.3.0 |
| Git Revision | 76e40f2fe61850f543518b3a028d0d11bf944344 |
| Release Date | Mon Dec 9 20:42:40 2024 +0000 |
| System Info | |
| Operating System | darwin |
| Architecture | aarch64 |
| Compiler | ghc |
| Compiler Version | 9.10 |
| Environment | |
| Environment Variables | STAN_USE_DEFAULT_CONFIG=True |
| TOML configuration files | /Users/kamilzabinski/IdeaProjects/helvm/helps/.stan.toml |
| CLI arguments | -s --hide-solution report |
Project Info
Information about the analysed project
| Project name | helps |
| Cabal Files | helps.cabal |
| HIE Files Directory | .hie |
| Files Number | 31 |
Analysis Info
Summary stats from the static analysis
| Modules | 31 |
| LoC | 6231 |
| Extensions | 32 |
| SafeHaskell Extensions | 0 |
| Available inspections | 48 |
| Checked inspections | 48 |
| Found Observations | 78 |
| Ignored Observations | 0 |
Static Analysis Summary
Here you can find the overall conclusion based on the various metadata and gathered information during the work of Stan on this project.
Project health: 64.58%
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.The project has low health
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.Watch out for STAN-0010
By the result of Stan analysis, the most common inspection for this project is STAN-0010Vulnerable module: HelVM.HelPS.HS2Lazy.Syntax
TheHelVM.HelPS.HS2Lazy.Syntaxmodule is the most vulnerable one in the project, as it got the most number of observationsPopular category: Partial
- Partial
Severity: Error
The highest severity of found observations is Error
Observations
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.
- HelVM.HelPS.Lang
- HelVM.Hel.Compiler.Barely
- HelVM.Hel.Compiler.Classy
- HelVM.Hel.Compiler.Effectively
- HelVM.Hel.Compiler.Typically
- HelVM.Hel.MiniHaskell.Classy
- HelVM.HelPS.Compiler.How
- HelVM.HelPS.HS2Lazy.Compiler.ProgramToExprConverter
- HelVM.HelPS.HS2Lazy.Facade
- HelVM.HelPS.HS2Lazy.PatComp.PatternMatchCompiler
- HelVM.HelPS.HS2Lazy.SCC
- HelVM.HelPS.HS2Lazy.Syntax
- HelVM.HelPS.HS2Lazy.Type
📄 hs/app/HelVM/HelPS/Lang.hs
Module HelVM.HelPS.LangLines of Code 10 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0010-S4h4fk-10:29 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/app/HelVM/HelPS/Lang.hs 9 ┃ 10 ┃ deriving stock (Bounded , Enum , Eq , Read , Show) 11 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0012-S4h4fk-10:29 Severity Warning Description Usage of partial function 'toEnum' for enumerable types Inspection ID STAN-0012 Category - Partial
File hs/app/HelVM/HelPS/Lang.hs 9 ┃ 10 ┃ deriving stock (Bounded , Enum , Eq , Read , Show) 11 ┃ ^^^^
Possible solutions
- {Extra dependency} Use 'safeToEnum' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0011-S4h4fk-10:29 Severity Warning Description Usage of partial function 'pred' for enumerable types Inspection ID STAN-0011 Category - Partial
File hs/app/HelVM/HelPS/Lang.hs 9 ┃ 10 ┃ deriving stock (Bounded , Enum , Eq , Read , Show) 11 ┃ ^^^^
Possible solutions
- Use '(- 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'prev' from 'Relude.Extra.Enum' in 'relude'
📄 hs/src/HelVM/Hel/Compiler/Barely.hs
Module HelVM.Hel.Compiler.BarelyLines of Code 748 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0010-1NUJ/w-102:21 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 101 ┃ 102 ┃ node k x l r = Bin (succ $ size l + size r) k x l r; 103 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-1NUJ/w-293:70 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 292 ┃ 293 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 294 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-1NUJ/w-293:136 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 292 ┃ 293 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 294 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-1NUJ/w-505:58 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 504 ┃ 505 ┃ { Nothing -> let { va = TV (showInt n "") } in ((va, succ n), (s, va):tab) 506 ┃ ^^^^Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-1NUJ/w-544:36 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 543 ┃ 544 ┃ fpair (infer' typed loc x (cs, succ n)) \tax csn1 -> fpair tax \tx ax -> 545 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-1NUJ/w-547:99 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 546 ┃ 547 ┃ ; L s x -> first (\ta -> fpair ta \t a -> (arr va t, L s a)) (infer' typed ((s, va):loc) x (cs, succ n)) 548 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-1NUJ/w-615:66 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 614 ┃ 615 ┃ fpair qn \q n -> let { v = '*':showInt n "" } in (((p, v):q, succ n), V v) 616 ┃ ^^^^Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-1NUJ/w-650:88 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Barely.hs 649 ┃ 650 ┃ dictVars ps n = flst ps ([], n) \p pt -> first ((p, '*':showInt n ""):) (dictVars pt $ succ n); 651 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
📄 hs/src/HelVM/Hel/Compiler/Classy.hs
Module HelVM.Hel.Compiler.ClassyLines of Code 589 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0010-kW22x2-175:70 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Classy.hs 174 ┃ 175 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 176 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-kW22x2-175:136 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Classy.hs 174 ┃ 175 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 176 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-kW22x2-247:91 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Classy.hs 246 ┃ 247 ┃ rank ds v = foldr (\d t -> ife (lstEq v (fst d)) (\n -> ('[':) . showInt n . (']':)) (t . succ)) undefined ds 0; 248 ┃ ^^^^Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
📄 hs/src/HelVM/Hel/Compiler/Effectively.hs
Module HelVM.Hel.Compiler.EffectivelyLines of Code 862 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0010-TD2Jmz-104:21 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Effectively.hs 103 ┃ 104 ┃ node k x l r = Bin (succ $ size l + size r) k x l r; 105 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-TD2Jmz-296:70 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Effectively.hs 295 ┃ 296 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 297 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-TD2Jmz-296:136 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Effectively.hs 295 ┃ 296 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 297 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-TD2Jmz-704:25 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Effectively.hs 703 ┃ 704 ┃ length = foldr (\_ n -> succ n) 0; 705 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
📄 hs/src/HelVM/Hel/Compiler/Typically.hs
Module HelVM.Hel.Compiler.TypicallyLines of Code 406 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0010-7brO3L-170:70 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Typically.hs 169 ┃ 170 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 171 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-7brO3L-170:136 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Typically.hs 169 ┃ 170 ┃ expr precTab = fix \r n -> ife (n <= 9) (liftA2 (opFold precTab) (r (succ n)) (many (liftA2 (\a b -> (a,b)) (opWithPrec precTab n) (r (succ n))))) (aexp (r 0)); 171 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-7brO3L-231:91 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/Compiler/Typically.hs 230 ┃ 231 ┃ rank ds v = foldr (\d t -> ife (lstEq v (fst d)) (\n -> ('[':) . showInt n . (']':)) (t . succ)) undefined ds 0; 232 ┃ ^^^^Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
📄 hs/src/HelVM/Hel/MiniHaskell/Classy.hs
Module HelVM.Hel.MiniHaskell.ClassyLines of Code 1241 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
- CPP
- FlexibleInstances
- NoMonomorphismRestriction
- TupleSections
- TypeSynonymInstances
Observations
ID OBS-STAN-0010-zQLoyM-580:57 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/MiniHaskell/Classy.hs 579 ┃ 580 ┃ ((fromMaybe undefined .) . opFold' precTab <$> r (succ n) <*> 581 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-zQLoyM-581:52 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/MiniHaskell/Classy.hs 580 ┃ 581 ┃ many (liftA2 (,) (opWithPrec precTab n) (r (succ n)))) 582 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0010-zQLoyM-738:71 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/Hel/MiniHaskell/Classy.hs 737 ┃ 738 ┃ ife (v == fst x) (Just ('[' : showInt c "]")) (loop xs v (succ c)) } } 739 ┃ ^^^^Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
📄 hs/src/HelVM/HelPS/Compiler/How.hs
Module HelVM.HelPS.Compiler.HowLines of Code 10 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0010-XahikW-10:29 Severity Warning Description Usage of partial function 'succ' for enumerable types Inspection ID STAN-0010 Category - Partial
File hs/src/HelVM/HelPS/Compiler/How.hs 9 ┃ 10 ┃ deriving stock (Bounded , Enum , Eq , Read , Show) 11 ┃ ^^^^
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0012-XahikW-10:29 Severity Warning Description Usage of partial function 'toEnum' for enumerable types Inspection ID STAN-0012 Category - Partial
File hs/src/HelVM/HelPS/Compiler/How.hs 9 ┃ 10 ┃ deriving stock (Bounded , Enum , Eq , Read , Show) 11 ┃ ^^^^
Possible solutions
- {Extra dependency} Use 'safeToEnum' from 'Relude.Extra.Enum' in 'relude'
ID OBS-STAN-0011-XahikW-10:29 Severity Warning Description Usage of partial function 'pred' for enumerable types Inspection ID STAN-0011 Category - Partial
File hs/src/HelVM/HelPS/Compiler/How.hs 9 ┃ 10 ┃ deriving stock (Bounded , Enum , Eq , Read , Show) 11 ┃ ^^^^
Possible solutions
- Use '(- 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'prev' from 'Relude.Extra.Enum' in 'relude'
📄 hs/src/HelVM/HelPS/HS2Lazy/Compiler/ProgramToExprConverter.hs
Module HelVM.HelPS.HS2Lazy.Compiler.ProgramToExprConverterLines of Code 19 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0213-XJgJ08-15:3 Severity Warning Description Pattern matching on '_' for sum types can create maintainability issues Inspection ID STAN-0213 Category - AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Compiler/ProgramToExprConverter.hs 14 ┃ 15 ┃ _ -> error "Illegal program entry point" 16 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Possible solutions
- Pattern match on each constructor explicitly
- Add meaningful names to holes, e.g. '_anyOtherFailure'
📄 hs/src/HelVM/HelPS/HS2Lazy/Facade.hs
Module HelVM.HelPS.HS2Lazy.FacadeLines of Code 42 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0302-W+Z2TR-34:39 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/Facade.hs 33 ┃ 34 ┃ analyze :: MonadSafe m => String -> m (Program, [Impl], ClassEnv, [Assump]) 35 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
📄 hs/src/HelVM/HelPS/HS2Lazy/PatComp/PatternMatchCompiler.hs
Module HelVM.HelPS.HS2Lazy.PatComp.PatternMatchCompilerLines of Code 212 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0103-Y2EG+E-36:29 Severity PotentialBug Description Usage of the 'length' function that hangs on infinite lists Inspection ID STAN-0103 Category - Infinite
- List
File hs/src/HelVM/HelPS/HS2Lazy/PatComp/PatternMatchCompiler.hs 35 ┃ 36 ┃ pcAlts qs = go =<< newVars (length $ fst $ unsafeHead qs) where 37 ┃ ^^^^^^
Possible solutions
- Don't use 'length' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
ID OBS-STAN-0005-Y2EG+E-78:25 Severity Warning Description Usage of partial function '!!' for lists Inspection ID STAN-0005 Category - Partial
- List
File hs/src/HelVM/HelPS/HS2Lazy/PatComp/PatternMatchCompiler.hs 77 ┃ 78 ┃ body = Rhs $ Var $ vs Unsafe.!! (i - 1) 79 ┃ ^^^^^^^^^
ID OBS-STAN-0003-Y2EG+E-143:49 Severity Warning Description Usage of partial function 'init' for lists Inspection ID STAN-0003 Category - Partial
- List
File hs/src/HelVM/HelPS/HS2Lazy/PatComp/PatternMatchCompiler.hs 142 ┃ 143 ┃ clauses = traverse (matchConClause us def) (Unsafe.init grps) 144 ┃ ^^^^^^^^^^^
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
ID OBS-STAN-0004-Y2EG+E-144:45 Severity Warning Description Usage of partial function 'last' for lists Inspection ID STAN-0004 Category - Partial
- List
File hs/src/HelVM/HelPS/HS2Lazy/PatComp/PatternMatchCompiler.hs 143 ┃ 144 ┃ lastClause = matchConLastClause us def (Unsafe.last grps) 145 ┃ ^^^^^^^^^^^
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
ID OBS-STAN-0103-Y2EG+E-169:20 Severity PotentialBug Description Usage of the 'length' function that hangs on infinite lists Inspection ID STAN-0103 Category - Infinite
- List
File hs/src/HelVM/HelPS/HS2Lazy/PatComp/PatternMatchCompiler.hs 168 ┃ 169 ┃ go n = n == 0 || length grps == n 170 ┃ ^^^^^^
Possible solutions
- Don't use 'length' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
ID OBS-STAN-0101-Y2EG+E-208:36 Severity PotentialBug Description Usage of the 'reverse' function that hangs on infinite lists Inspection ID STAN-0101 Category - Infinite
- List
File hs/src/HelVM/HelPS/HS2Lazy/PatComp/PatternMatchCompiler.hs 207 ┃ 208 ┃ foldrM f a xs = foldlM (flip f) a (reverse xs) 209 ┃ ^^^^^^^
Possible solutions
- Don't use 'reverse' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
📄 hs/src/HelVM/HelPS/HS2Lazy/SCC.hs
Module HelVM.HelPS.HS2Lazy.SCCLines of Code 95 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0302-lPTyYY-37:19 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 36 ┃ 37 ┃ type SCC i a = SM (Int, Array i Int, [i], [[i]]) a 38 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0302-lPTyYY-40:39 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 39 ┃ 40 ┃ newId = changeSM (\(i,m,s,r) -> (i+1, (i+1,m,s,r))) 41 ┃ ^^^^^^^^^^^
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0302-lPTyYY-43:38 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 42 ┃ 43 ┃ setId v i = updateSM (\(i',m,s,r) -> (i', m // [(v, i)], s, r)) 44 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0302-lPTyYY-49:34 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 48 ┃ 49 ┃ push v = updateSM (\(i,m,s,r) -> (i,m,v:s,r)) 50 ┃ ^^^^^^^^^^^
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0302-lPTyYY-56:22 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 55 ┃ 56 ┃ in (i,m',s',r') 57 ┃ ^^^^^^^^^^^^
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0202-lPTyYY-68:30 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 67 ┃ 68 ┃ let minId = foldl min nodeId ids 69 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0005-lPTyYY-73:24 Severity Warning Description Usage of partial function '!!' for lists Inspection ID STAN-0005 Category - Partial
- List
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 72 ┃ 73 ┃ scc adj = map (map (vs !!)) (scc' adj') 74 ┃ ^^
ID OBS-STAN-0103-lPTyYY-74:28 Severity PotentialBug Description Usage of the 'length' function that hangs on infinite lists Inspection ID STAN-0103 Category - Infinite
- List
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 73 ┃ 74 ┃ where adj' = array (0, length adj - 1) (map toIndex adj) 75 ┃ ^^^^^^
Possible solutions
- Don't use 'length' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
ID OBS-STAN-0302-lPTyYY-83:34 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/SCC.hs 82 ┃ 83 ┃ where (_, (_,_,_,r)) = runSM (0, idMap, [], []) sm 84 ┃ ^^^^^^^^^^^^^^^^^^
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
📄 hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs
Module HelVM.HelPS.HS2Lazy.SyntaxLines of Code 500 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0019-0WnPe9-50:11 Severity Warning Description Usage of partial function 'foldr1' for Inspection ID STAN-0019 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 49 ┃ 50 ┃ g = foldr1 (\l r -> l . (' ' :) . r) (map (showsPrec 3) ts) 51 ┃ ^^^^^^ID OBS-STAN-0213-0WnPe9-60:13 Severity Warning Description Pattern matching on '_' for sum types can create maintainability issues Inspection ID STAN-0213 Category - AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 59 ┃ 60 ┃ _ -> error "Type" 61 ┃ ^^^^^^^^^^^^^^^^^^^^^
Possible solutions
- Pattern match on each constructor explicitly
- Add meaningful names to holes, e.g. '_anyOtherFailure'
ID OBS-STAN-0213-0WnPe9-68:13 Severity Warning Description Pattern matching on '_' for sum types can create maintainability issues Inspection ID STAN-0213 Category - AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 67 ┃ 68 ┃ _ -> error "Type" 69 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Possible solutions
- Pattern match on each constructor explicitly
- Add meaningful names to holes, e.g. '_anyOtherFailure'
ID OBS-STAN-0019-0WnPe9-72:15 Severity Warning Description Usage of partial function 'foldr1' for Inspection ID STAN-0019 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 71 ┃ 72 ┃ foldr1 73 ┃ ^^^^^^
ID OBS-STAN-0213-0WnPe9-75:7 Severity Warning Description Pattern matching on '_' for sum types can create maintainability issues Inspection ID STAN-0213 Category - AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 74 ┃ 75 ┃ _ -> 76 ┃ showParen (p > 2) $ 77 ┃ foldr1 78 ┃ (\f g -> f . (' ' :) . g) 79 ┃ (map (showsPrec 3) (t : ts)) 80 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Possible solutions
- Pattern match on each constructor explicitly
- Add meaningful names to holes, e.g. '_anyOtherFailure'
ID OBS-STAN-0019-0WnPe9-77:11 Severity Warning Description Usage of partial function 'foldr1' for Inspection ID STAN-0019 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 76 ┃ 77 ┃ foldr1 78 ┃ ^^^^^^
ID OBS-STAN-0302-0WnPe9-172:9 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 171 ┃ 172 ┃ [ ("True", 0, 1, tBool, tBool), 173 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0302-0WnPe9-173:9 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 172 ┃ 173 ┃ ("False", 0, 2, tBool, tBool), 174 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0302-0WnPe9-174:9 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 173 ┃ 174 ┃ (":", 2, 1, tList, a_ `fn` list a_ `fn` list a_), 175 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0302-0WnPe9-175:9 Severity Style Description Using tuples of big size (>= 4) can decrease code readability Inspection ID STAN-0302 Category - AntiPattern
- Syntax
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 174 ┃ 175 ┃ ("[]", 0, 2, tList, list a_) 176 ┃ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^Possible solutions
- Consider defining and using a custom data type to improve code comprehension
ID OBS-STAN-0008-0WnPe9-181:11 Severity Warning Description Usage of partial function 'fromJust' for 'Maybe' Inspection ID STAN-0008 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 180 ┃ 181 ┃ con = fromJust $ find (\c -> conName c == "True") preludeConstrs 182 ┃ ^^^^^^^^
Possible solutions
- Use explicit pattern-matching over Maybe
- Use one of the standard functions: 'maybe', 'fromMaybe'
ID OBS-STAN-0008-0WnPe9-186:11 Severity Warning Description Usage of partial function 'fromJust' for 'Maybe' Inspection ID STAN-0008 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 185 ┃ 186 ┃ con = fromJust $ find (\c -> conName c == "False") preludeConstrs 187 ┃ ^^^^^^^^
Possible solutions
- Use explicit pattern-matching over Maybe
- Use one of the standard functions: 'maybe', 'fromMaybe'
ID OBS-STAN-0008-0WnPe9-191:11 Severity Warning Description Usage of partial function 'fromJust' for 'Maybe' Inspection ID STAN-0008 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 190 ┃ 191 ┃ con = fromJust $ find (\c -> conName c == ":") preludeConstrs 192 ┃ ^^^^^^^^
Possible solutions
- Use explicit pattern-matching over Maybe
- Use one of the standard functions: 'maybe', 'fromMaybe'
ID OBS-STAN-0008-0WnPe9-196:11 Severity Warning Description Usage of partial function 'fromJust' for 'Maybe' Inspection ID STAN-0008 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 195 ┃ 196 ┃ con = fromJust $ find (\c -> conName c == "[]") preludeConstrs 197 ┃ ^^^^^^^^
Possible solutions
- Use explicit pattern-matching over Maybe
- Use one of the standard functions: 'maybe', 'fromMaybe'
ID OBS-STAN-0008-0WnPe9-201:11 Severity Warning Description Usage of partial function 'fromJust' for 'Maybe' Inspection ID STAN-0008 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 200 ┃ 201 ┃ con = fromJust $ find (\c -> conName c == ":") preludeConstrs 202 ┃ ^^^^^^^^
Possible solutions
- Use explicit pattern-matching over Maybe
- Use one of the standard functions: 'maybe', 'fromMaybe'
ID OBS-STAN-0008-0WnPe9-206:11 Severity Warning Description Usage of partial function 'fromJust' for 'Maybe' Inspection ID STAN-0008 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 205 ┃ 206 ┃ con = fromJust $ find (\c -> conName c == "[]") preludeConstrs 207 ┃ ^^^^^^^^
Possible solutions
- Use explicit pattern-matching over Maybe
- Use one of the standard functions: 'maybe', 'fromMaybe'
ID OBS-STAN-0209-0WnPe9-259:8 Severity Performance Description Usage of 'nub' on lists that runs in quadratic time Inspection ID STAN-0209 Category - AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 258 ┃ 259 ┃ tv = nub . concat . map tv 260 ┃ ^^^
Possible solutions
- {Extra dependency} Switch list to 'Set' from 'containers'
- {Extra dependency} Use 'ordNub/hashNub/sortNub/unstableNub' from 'relude'
- {Extra dependency} Use 'nubOrd' from 'containers'
- {Extra dependency} Use 'nubOrd' from 'extra'
ID OBS-STAN-0019-0WnPe9-282:11 Severity Warning Description Usage of partial function 'foldr1' for Inspection ID STAN-0019 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 281 ┃ 282 ┃ foldr1 (\f g -> f . (", " ++) . g) (map shows p) 283 ┃ ^^^^^^ID OBS-STAN-0202-0WnPe9-377:6 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 376 ┃ 377 ┃ ap = foldl Ap 378 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0017-0WnPe9-412:15 Severity Warning Description Usage of partial function 'foldl1' for Inspection ID STAN-0017 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 411 ┃ 412 ┃ fvAlts alts = foldl1 union (map fvAlt alts) 413 ┃ ^^^^^^
ID OBS-STAN-0202-0WnPe9-427:15 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 426 ┃ 427 ┃ tuptype = foldl TAp (TCon tycon) tvars 428 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0202-0WnPe9-439:12 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 438 ┃ 439 ┃ tuple es = foldl Ap (Con $ tupcon $ length es) es 440 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0103-0WnPe9-439:37 Severity PotentialBug Description Usage of the 'length' function that hangs on infinite lists Inspection ID STAN-0103 Category - Infinite
- List
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 438 ┃ 439 ┃ tuple es = foldl Ap (Con $ tupcon $ length es) es 440 ┃ ^^^^^^
Possible solutions
- Don't use 'length' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
ID OBS-STAN-0202-0WnPe9-481:7 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 480 ┃ 481 ┃ sap = foldl SAp 482 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0101-0WnPe9-494:56 Severity PotentialBug Description Usage of the 'reverse' function that hangs on infinite lists Inspection ID STAN-0101 Category - Infinite
- List
File hs/src/HelVM/HelPS/HS2Lazy/Syntax.hs 493 ┃ 494 ┃ dependency bs = (map . map) (\v -> (v, lookup' v bs)) (reverse vss) 495 ┃ ^^^^^^^
Possible solutions
- Don't use 'reverse' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
📄 hs/src/HelVM/HelPS/HS2Lazy/Type.hs
Module HelVM.HelPS.HS2Lazy.TypeLines of Code 666 - EmptyDataDecls
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- InstanceSigs
- KindSignatures
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NamedFieldPuns
- OverloadedStrings
- PartialTypeSignatures
- PatternGuards
- PolyKinds
- RankNTypes
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeFamilies
- TypeSynonymInstances
- ViewPatterns
- TypeOperators
- DerivingStrategies
- ConstraintKinds
- StrictData
- BlockArguments
Observations
ID OBS-STAN-0301-wIjzfP-20:1 Severity Style Description Using the implicit default fixity for operator: infixl 9 Inspection ID STAN-0301 Category - Syntax
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 19 ┃ 20 ┃ (+->) :: Tyvar -> Type -> Subst 21 ┃ ^^^^^
Possible solutions
- Add 'infix[l|r]' declaration to the operator with explicit precedence
ID OBS-STAN-0005-wIjzfP-242:26 Severity Warning Description Usage of partial function '!!' for lists Inspection ID STAN-0005 Category - Partial
- List
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 241 ┃ 242 ┃ inst ts (TGen n) = ts !! n 243 ┃ ^^
ID OBS-STAN-0202-wIjzfP-325:39 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 324 ┃ 325 ┃ return (ps, t, foldl Ap e (map ClassPH ps)) 326 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0001-wIjzfP-448:42 Severity Warning Description Usage of partial function 'head' for lists Inspection ID STAN-0001 Category - Partial
- List
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 447 ┃ 448 ┃ | otherwise = return (f vps (map List.head tss)) 449 ┃ ^^^^^^^^^
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
ID OBS-STAN-0202-wIjzfP-470:43 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 469 ┃ 470 ┃ reRec = [(i, foldl Ap (Var i) (map ClassPH ps)) 471 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0202-wIjzfP-502:30 Severity Error Description Usage of space-leaking function 'foldl' Inspection ID STAN-0202 Category - SpaceLeak
- AntiPattern
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 501 ┃ 502 ┃ Just (ps, e') -> foldl Ap e' (map (resolveExpr re . ClassPH) ps) 503 ┃ ^^^^^
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
ID OBS-STAN-0019-wIjzfP-562:22 Severity Warning Description Usage of partial function 'foldr1' for Inspection ID STAN-0019 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 561 ┃ 562 ┃ gs = foldr1 union vss \\ fs 563 ┃ ^^^^^^
ID OBS-STAN-0019-wIjzfP-563:33 Severity Warning Description Usage of partial function 'foldr1' for Inspection ID STAN-0019 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 562 ┃ 563 ┃ (ds, rs) <- split ce fs (foldr1 intersect vss) ps' 564 ┃ ^^^^^^
ID OBS-STAN-0017-wIjzfP-635:19 Severity Warning Description Usage of partial function 'foldl1' for Inspection ID STAN-0017 Category - Partial
File hs/src/HelVM/HelPS/HS2Lazy/Type.hs 634 ┃ 635 ┃ addCoreClasses = foldl1 (<:>) [ 636 ┃ ^^^^^^
Configurations
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.
| Action | Filter | Scope |
|---|
Configuration Process Information
Information and warnings that were gathered during the configuration assemble process. This helps to understand how different parts of the configurations were retrieved.
- No TOML value is specified for key: check
- No CLI option specified for: checks
- configChecks is set through the source: TOML
- No TOML value is specified for key: remove
- No CLI option specified for: remove
- configRemoved is set through the source: TOML
- No TOML value is specified for key: ignore
- No CLI option specified for: ignore
- configIgnored is set through the source: TOML
Report Explained
Inspections
List of Inspections used for analysing the project
Inspection STAN-0001
Partial: ghc-internal/head
Usage of partial function 'head' for lists
- Partial
- List
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
Inspection STAN-0002
Partial: ghc-internal/tail
Usage of partial function 'tail' for lists
- Partial
- List
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
Inspection STAN-0003
Partial: ghc-internal/init
Usage of partial function 'init' for lists
- Partial
- List
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
Inspection STAN-0004
Partial: ghc-internal/last
Usage of partial function 'last' for lists
- Partial
- List
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
Inspection STAN-0005
Partial: ghc-internal/!!
Usage of partial function '!!' for lists
- Partial
- List
Inspection STAN-0006
Partial: ghc-internal/cycle
Usage of partial function 'cycle' for lists
- Partial
- List
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
Inspection STAN-0007
Partial: ghc-internal/genericIndex
Usage of partial function 'genericIndex' for lists
- Partial
- List
Inspection STAN-0008
Partial: ghc-internal/fromJust
Usage of partial function 'fromJust' for 'Maybe'
- Partial
Possible solutions
- Use explicit pattern-matching over Maybe
- Use one of the standard functions: 'maybe', 'fromMaybe'
Inspection STAN-0009
Partial: ghc-internal/read
Usage of partial function 'read' for parsing 'String'
- Partial
Possible solutions
- Use 'readMaybe' or 'readEither' to handle failed parsing
Inspection STAN-0010
Partial: ghc-internal/succ
Usage of partial function 'succ' for enumerable types
- Partial
Possible solutions
- Use '(+ 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'next' from 'Relude.Extra.Enum' in 'relude'
Inspection STAN-0011
Partial: ghc-internal/pred
Usage of partial function 'pred' for enumerable types
- Partial
Possible solutions
- Use '(- 1)' for integral types (but be aware of arithmetic overflow)
- {Extra dependency} Use 'prev' from 'Relude.Extra.Enum' in 'relude'
Inspection STAN-0012
Partial: ghc-internal/toEnum
Usage of partial function 'toEnum' for enumerable types
- Partial
Possible solutions
- {Extra dependency} Use 'safeToEnum' from 'Relude.Extra.Enum' in 'relude'
Inspection STAN-0013
Partial: ghc-internal/maximum
Usage of partial function 'maximum' for
- Partial
Inspection STAN-0014
Partial: ghc-internal/minimum
Usage of partial function 'minimum' for
- Partial
Inspection STAN-0015
Partial: ghc-internal/maximumBy
Usage of partial function 'maximumBy' for
- Partial
Inspection STAN-0016
Partial: ghc-internal/minimumBy
Usage of partial function 'minimumBy' for
- Partial
Inspection STAN-0017
Partial: ghc-internal/foldl1
Usage of partial function 'foldl1' for
- Partial
Inspection STAN-0018
Partial: ghc-internal/foldl1'
Usage of partial function 'foldl1'' for lists
- Partial
- List
Possible solutions
- Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
- Use explicit pattern-matching over lists
Inspection STAN-0019
Partial: ghc-internal/foldr1
Usage of partial function 'foldr1' for
- Partial
Inspection STAN-0020
Partial: ghc-internal/fromList
Usage of partial function 'fromList' for
- Partial
Inspection STAN-0021
Partial: ghc-internal/fromInteger
Usage of partial function 'fromInteger' for
- Partial
Inspection STAN-0022
Partial: ghc-internal/fromRational
Usage of partial function 'fromRational' for Scientific
- Partial
Possible solutions
- Use a function like 'Data.Scientific.fromRationalRepetend' that handles repeating decimals
- Convert to a fractional type like 'Double'
Inspection STAN-0023
Partial: ghc-internal/realToFrac
Usage of partial function 'realToFrac' for Scientific
- Partial
Possible solutions
- Use 'Data.Scientific.fromFloatDigits'
- use a function that handles repeating decimals, e.g. 'Data.Scientific.fromRationalRepetend . toRational'
Inspection STAN-0024
Partial: ghc-internal/recip
Usage of partial function 'recip' for Scientific
- Partial
Possible solutions
- Convert to a fractional type like 'Double'
Inspection STAN-0025
Partial: ghc-internal//
Usage of partial function '/' for Scientific
- Partial
Possible solutions
- Convert to a fractional type like 'Double'
Inspection STAN-0101
Infinite: ghc-internal/reverse
Usage of the 'reverse' function that hangs on infinite lists
- Infinite
- List
Possible solutions
- Don't use 'reverse' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
Inspection STAN-0102
Infinite: ghc-internal/isSuffixOf
Usage of the 'isSuffixOf' function that hangs on infinite lists
- Infinite
- List
Possible solutions
- Don't use 'isSuffixOf' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
Inspection STAN-0103
Infinite: ghc-internal/length
Usage of the 'length' function that hangs on infinite lists
- Infinite
- List
Possible solutions
- Don't use 'length' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
Inspection STAN-0104
Infinite: ghc-internal/genericLength
Usage of the 'genericLength' function that hangs on infinite lists
- Infinite
- List
Possible solutions
- Don't use 'genericLength' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
Inspection STAN-0105
Infinite: ghc-internal/sum
Usage of the 'sum' function that hangs on infinite lists
- Infinite
- List
Possible solutions
- Don't use 'sum' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
Inspection STAN-0106
Infinite: ghc-internal/product
Usage of the 'product' function that hangs on infinite lists
- Infinite
- List
Possible solutions
- Don't use 'product' if you expect your function to work with infinite lists
- {Extra dependency} Use the 'slist' library for fast and safe functions on infinite lists
Inspection STAN-0201
Anti-pattern: [0 .. length xs]
Creating a list with wrong number of indices
- AntiPattern
Possible solutions
- Replace '[0 .. length xs]' with '[0 .. length xs - 1]'
- Use 'zip [0 ..] xs` to work with list of pairs: index and element
Inspection STAN-0202
Anti-pattern: foldl
Usage of space-leaking function 'foldl'
- SpaceLeak
- AntiPattern
Possible solutions
- Replace 'foldl' with 'foldl''
- Use 'foldr (flip . f)` instead of 'foldl f'
Inspection STAN-0203
Anti-pattern: Data.ByteString.Char8.pack
Usage of 'pack' function that doesn't handle Unicode characters
- AntiPattern
Possible solutions
- Convert to 'Text' and use 'encodeUtf8' from 'Data.Text.Encoding'
- {Extra dependency} Use 'encodeUtf8' from 'relude'
- {Extra dependency} Use the 'utf8-string' package
Inspection STAN-0204
Anti-pattern: HashMap size
Usage of 'size' or 'length' for 'HashMap' that runs in linear time
- AntiPattern
Possible solutions
- {Extra dependency} Switch to 'Map' from 'containers'
Inspection STAN-0205
Anti-pattern: HashSet size
Usage of 'size' or 'length' for 'HashSet' that runs in linear time
- AntiPattern
Possible solutions
- {Extra dependency} Switch to 'Set' from 'containers'
Inspection STAN-0206
Data types with non-strict fields
Defining lazy fields in data types can lead to unexpected space leaks
- SpaceLeak
- Syntax
Possible solutions
- Add '!' before the type, e.g. !Int or !(Maybe Bool)
- Enable the 'StrictData' extension: {-# LANGUAGE StrictData #-}
Inspection STAN-0207
Anti-pattern: Foldable methods on possibly error-prone structures
Usage of Foldable methods on (,), Maybe, Either
- AntiPattern
Possible solutions
- Use more explicit functions with specific monomorphic types
Inspection STAN-0208
Anti-pattern: Slow 'length' for Text
Usage of 'length' for 'Text' that runs in linear time
- AntiPattern
Possible solutions
- {Extra dependency} Switch to 'ByteString' from 'bytestring'
Inspection STAN-0209
Anti-pattern: Slow 'nub' for lists
Usage of 'nub' on lists that runs in quadratic time
- AntiPattern
Possible solutions
- {Extra dependency} Switch list to 'Set' from 'containers'
- {Extra dependency} Use 'ordNub/hashNub/sortNub/unstableNub' from 'relude'
- {Extra dependency} Use 'nubOrd' from 'containers'
- {Extra dependency} Use 'nubOrd' from 'extra'
Inspection STAN-0210
Anti-pattern: Slow 'for_' on ranges
Usage of 'for_' or 'forM_' on numerical ranges is slow
- AntiPattern
Possible solutions
- {Extra dependency} Use 'loop' library for fast monadic looping
Inspection STAN-0211
Anti-pattern: '</>' for URLs
Usage of '</>' for URLs results in the errors on Windows
- AntiPattern
Possible solutions
- {Extra dependency} Use type-safe library for URLs
- Concatenate URLs with slashes '/'
Inspection STAN-0212
Anti-pattern: unsafe functions
Usage of unsafe functions breaks referential transparency
- Unsafe
- AntiPattern
Possible solutions
- Remove 'undefined' or at least replace with 'error' to give better error messages
- Replace 'unsafeCoerce' with 'coerce'
- Rewrite the code to avoid using 'unsafePerformIO' and other unsafe IO functions
Inspection STAN-0213
Anti-pattern: Pattern matching on '_'
Pattern matching on '_' for sum types can create maintainability issues
- AntiPattern
Possible solutions
- Pattern match on each constructor explicitly
- Add meaningful names to holes, e.g. '_anyOtherFailure'
Inspection STAN-0214
Anti-pattern: use 'compare'
Usage of multiple comparison operators instead of single 'compare'
- AntiPattern
Possible solutions
- Rewrite code to use single 'compare' instead of many comparison operators
Inspection STAN-0215
Anti-pattern: Slashes in paths
Usage of '/' or '\' in paths results in the errors on different operation systems
- AntiPattern
Possible solutions
- {Extra dependency} Use '</>' operator from 'filepath'
Inspection STAN-0301
Missing fixity declaration for operator
Using the implicit default fixity for operator: infixl 9
- Syntax
Possible solutions
- Add 'infix[l|r]' declaration to the operator with explicit precedence
Inspection STAN-0302
Big tuples
Using tuples of big size (>= 4) can decrease code readability
- AntiPattern
- Syntax
Possible solutions
- Consider defining and using a custom data type to improve code comprehension
Severity
We are using the following severity system to indicate the observation level
| Severity | Description |
|---|---|
| Style | Code style issues. Usually harmless. |
| Performance | Serious defects that could cause slowness and space leaking. |
| PotentialBug | Human errors in code. |
| Warning | Potential runtime errors on some inputs. |
| Error | Dangerous behaviour. |