From 6aa01e3c314ff0d390de4b70f24e355c8b0d6cea Mon Sep 17 00:00:00 2001 From: Kamil Adam Date: Mon, 29 Jul 2024 19:18:02 +0200 Subject: [PATCH] Fix reports --- ...ulators.Combinators.Zot.Calculator.hs.html | 6 +- docs/reports/hlint.html | 70 +++++++++++-------- docs/reports/stan.html | 2 +- 3 files changed, 46 insertions(+), 32 deletions(-) diff --git a/docs/reports/heltc-test/heltc-0.1.4.0-inplace/HelVM.HelTC.Calculators.Combinators.Zot.Calculator.hs.html b/docs/reports/heltc-test/heltc-0.1.4.0-inplace/HelVM.HelTC.Calculators.Combinators.Zot.Calculator.hs.html index 349d6a3..b7128b6 100644 --- a/docs/reports/heltc-test/heltc-0.1.4.0-inplace/HelVM.HelTC.Calculators.Combinators.Zot.Calculator.hs.html +++ b/docs/reports/heltc-test/heltc-0.1.4.0-inplace/HelVM.HelTC.Calculators.Combinators.Zot.Calculator.hs.html @@ -46,17 +46,17 @@ 27 import qualified Data.Text.Lazy as LT 28 29 evalSource :: BIO m => FormatType -> Source -> m Output - 30 evalSource t s = wGetContentsText >>= (evalWithFormat t s) + 30 evalSource t s = wGetContentsText >>= evalWithFormat t s 31 32 evalWithFormat :: MonadSafe m => FormatType -> Source -> LT.Text -> m Output 33 evalWithFormat BinaryLabel source input = pure $ showFoldable $ evalInternal source input - 34 evalWithFormat TextLabel source input = (makeAsciiText28 . convert . evalInternal source) . showExpressionList =<< stringToDL (toString input) + 34 evalWithFormat TextLabel source input = (makeAsciiText28 <$> convert <$> evalInternal source) <$> showExpressionList =<< stringToDL (toString input) 35 36 evalInternal :: Source -> LT.Text -> ExpressionDList 37 evalInternal source input = eval $ fromStrict source <> input 38 39 eval :: LT.Text -> ExpressionDList - 40 eval = execWriter . runExpressionList . parse + 40 eval = execWriter <$> runExpressionList <$> parse diff --git a/docs/reports/hlint.html b/docs/reports/hlint.html index 5c79cd7..42d07b1 100644 --- a/docs/reports/hlint.html +++ b/docs/reports/hlint.html @@ -161,43 +161,28 @@

All hints

All files

Report generated by HLint -v3.1.6 +v3.5 - a tool to suggest improvements to your Haskell code.

-dist-newstyle/src/helio-157a2fc26d319c83/hs/test/HelVM/HelIO/Collections/MapListSpec.hs:50:11-112: Suggestion: Reduce duplication
-Found
-
it "mapListToList . fromIntIndexedList"
-  $ (mapListToList . fromIntIndexedList) input `shouldBe` output
-it "I.toList      . fromIntIndexedList"
-  $ (I.toList . fromIntIndexedList) input `shouldBe` output
-it "LL.toList     . fromIntIndexedList"
-  $ (LL.toList . fromIntIndexedList) input `shouldBe` output
-
-Perhaps
-
Combine with dist-newstyle/src/helio-157a2fc26d319c83/hs/test/HelVM/HelIO/Collections/MapListSpec.hs:59:11-112
- -
- -
hs/app/AppOptions.hs:(64,1)-(66,55): Warning: Redundant lambda
Found
calculatorParams
@@ -213,7 +198,7 @@
 
 
-
+
hs/app/Main.hs:(25,1)-(28,55): Warning: Redundant lambda
Found
runApp
@@ -229,7 +214,7 @@
 
 
-
+
hs/app/Main.hs:(35,1)-(36,61): Warning: Redundant lambda
Found
run
@@ -241,12 +226,41 @@
 
 
+
+hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:34:43-118: Warning: Functor law
+Found
+
(makeAsciiText28 <$> convert <$> evalInternal source)
+  <$> showExpressionList
+Perhaps
+
((makeAsciiText28 <$> convert) . evalInternal source
+   <$> showExpressionList)
+ +
+ +
+hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:34:44-94: Warning: Functor law
+Found
+
makeAsciiText28 <$> convert <$> evalInternal source
+Perhaps
+
makeAsciiText28 . convert <$> evalInternal source
+ +
+ +
+hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:40:8-49: Warning: Functor law
+Found
+
execWriter <$> runExpressionList <$> parse
+Perhaps
+
execWriter . runExpressionList <$> parse
+ +
+
-hs/src/HelVM/HelTC/Calculators/Combinators/Zot/Calculator.hs:30:39-58: Suggestion: Redundant bracket
+hs/src/HelVM/HelTC/Calculators/Lambda/DefinitionExpander.hs:30:55-113: Warning: Use mapM
Found
-
wGetContentsText >>= (evalWithFormat t s)
+
sequence (expandDefinitionByMap m <$> removeDefinitions il)
Perhaps
-
wGetContentsText >>= evalWithFormat t s
+
mapM (expandDefinitionByMap m) (removeDefinitions il)
diff --git a/docs/reports/stan.html b/docs/reports/stan.html index 75faa0f..31e18ce 100644 --- a/docs/reports/stan.html +++ b/docs/reports/stan.html @@ -1,5 +1,5 @@ -Stan Report

Stan Report

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
Version0.0.1.0
Git Revisiondcbc8682a964ae6f642ae37adbd46f6545d39aa6
Release DateFri Jul 29 13:18:20 2022 +0100
System Info
Operating Systemlinux
Architecturex86_64
Compilerghc
Compiler Version8.10
Environment
Environment VariablesSTAN_USE_DEFAULT_CONFIG=True
TOML configuration files/home/kamil-adam/git/helvm/heltc/.stan.toml
CLI arguments-s --hide-solution report

Project Info

Information about the analysed project

Project nameheltc
Cabal Filesheltc.cabal
HIE Files Directory.hie
Files Number77

Analysis Info

Summary stats from the static analysis

Modules77
LoC2820
Extensions29
SafeHaskell Extensions0
Available inspections44
Checked inspections44
Found Observations5
Ignored Observations0

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: 95.45%

    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 medium health

    Stan discovered several potential issues in the project. Nice job, the overall project quality is good. And you can easily make it even better!
  • Watch out for STAN-0001

    By the result of Stan analysis, the most common inspection for this project is STAN-0001
  • Vulnerable module: HelVM.HelTC.Calculators.Legacy.Parsers.LambdaParser

    The HelVM.HelTC.Calculators.Legacy.Parsers.LambdaParser module is the most vulnerable one in the project, as it got the most number of observations
  • Popular category: Partial

    • Partial
    The project has the most problems with inspections from this category
  • Severity: Warning

    The highest severity of found observations is Warning

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.

📄 hs/src/HelVM/HelTC/Calculators/Legacy/Parsers/LambdaParser.hs

  • ModuleHelVM.HelTC.Calculators.Legacy.Parsers.LambdaParser
    Lines of Code51
    1. EmptyDataDecls
    2. ExistentialQuantification
    3. FlexibleContexts
    4. FlexibleInstances
    5. FunctionalDependencies
    6. GADTs
    7. GeneralizedNewtypeDeriving
    8. InstanceSigs
    9. KindSignatures
    10. LambdaCase
    11. MultiParamTypeClasses
    12. MultiWayIf
    13. NamedFieldPuns
    14. OverloadedStrings
    15. PartialTypeSignatures
    16. PatternGuards
    17. PolyKinds
    18. RankNTypes
    19. RecordWildCards
    20. ScopedTypeVariables
    21. StandaloneDeriving
    22. TupleSections
    23. TypeFamilies
    24. TypeSynonymInstances
    25. ViewPatterns
    26. TypeOperators
    27. DerivingStrategies
    28. ConstraintKinds
    29. StrictData
    1. Observations

      IDOBS-STAN-0001-he9JRt-12:27
      SeverityWarning
      DescriptionUsage of partial function 'head' for lists
      Inspection IDSTAN-0001
      Category
      • Partial
      • List
      Filehs/src/HelVM/HelTC/Calculators/Legacy/Parsers/LambdaParser.hs
        11 ┃ 
      +Stan Report

      Stan Report

      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
      Version0.0.1.0
      Git Revisiondcbc8682a964ae6f642ae37adbd46f6545d39aa6
      Release DateFri Jul 29 13:18:20 2022 +0100
      System Info
      Operating Systemlinux
      Architecturex86_64
      Compilerghc
      Compiler Version8.10
      Environment
      Environment VariablesSTAN_USE_DEFAULT_CONFIG=True
      TOML configuration files/home/kamil-adam/git/helvm/heltc/.stan.toml
      CLI arguments-s --hide-solution report

      Project Info

      Information about the analysed project

      Project nameheltc
      Cabal Filesheltc.cabal
      HIE Files Directory.hie
      Files Number77

      Analysis Info

      Summary stats from the static analysis

      Modules77
      LoC2792
      Extensions29
      SafeHaskell Extensions0
      Available inspections44
      Checked inspections44
      Found Observations5
      Ignored Observations0

      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: 95.45%

        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 medium health

        Stan discovered several potential issues in the project. Nice job, the overall project quality is good. And you can easily make it even better!
      • Watch out for STAN-0001

        By the result of Stan analysis, the most common inspection for this project is STAN-0001
      • Vulnerable module: HelVM.HelTC.Calculators.Legacy.Parsers.LambdaParser

        The HelVM.HelTC.Calculators.Legacy.Parsers.LambdaParser module is the most vulnerable one in the project, as it got the most number of observations
      • Popular category: Partial

        • Partial
        The project has the most problems with inspections from this category
      • Severity: Warning

        The highest severity of found observations is Warning

      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.

      📄 hs/src/HelVM/HelTC/Calculators/Legacy/Parsers/LambdaParser.hs

      • ModuleHelVM.HelTC.Calculators.Legacy.Parsers.LambdaParser
        Lines of Code51
        1. EmptyDataDecls
        2. ExistentialQuantification
        3. FlexibleContexts
        4. FlexibleInstances
        5. FunctionalDependencies
        6. GADTs
        7. GeneralizedNewtypeDeriving
        8. InstanceSigs
        9. KindSignatures
        10. LambdaCase
        11. MultiParamTypeClasses
        12. MultiWayIf
        13. NamedFieldPuns
        14. OverloadedStrings
        15. PartialTypeSignatures
        16. PatternGuards
        17. PolyKinds
        18. RankNTypes
        19. RecordWildCards
        20. ScopedTypeVariables
        21. StandaloneDeriving
        22. TupleSections
        23. TypeFamilies
        24. TypeSynonymInstances
        25. ViewPatterns
        26. TypeOperators
        27. DerivingStrategies
        28. ConstraintKinds
        29. StrictData
        1. Observations

          IDOBS-STAN-0001-he9JRt-12:27
          SeverityWarning
          DescriptionUsage of partial function 'head' for lists
          Inspection IDSTAN-0001
          Category
          • Partial
          • List
          Filehs/src/HelVM/HelTC/Calculators/Legacy/Parsers/LambdaParser.hs
            11 ┃ 
             12 ┃ parseLambda = fst . fst . Unsafe.head . (lambdaParser >*> eof) . lexer . toString
             13 ┃                           ^^^^^^^^^^^
           

          Possible solutions

          • Replace list with 'NonEmpty' from 'Data.List.NonEmpty'
          • Use explicit pattern-matching over lists
          IDOBS-STAN-0001-he9JRt-33:31
          SeverityWarning
          DescriptionUsage of partial function 'head' for lists
          Inspection IDSTAN-0001
          Category
          • Partial
          • List
          Filehs/src/HelVM/HelTC/Calculators/Legacy/Parsers/LambdaParser.hs
            32 ┃