Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Main module parsing inputs, and running analysis.
Synopsis
- measureAll :: Metric m c => Assessment m -> (a -> [c]) -> Proxy m -> Proxy c -> a -> Log
- measureTopOccurs :: (Data from, Metric m c) => Assessment m -> Proxy m -> Proxy c -> from -> Log
- measureAllOccurs :: (Data from, Metric m c) => Assessment m -> Proxy m -> Proxy c -> from -> Log
- type Assessment m = m -> (Severity, String)
- warnOfMeasure :: (CodeFragment c, Metric m c) => Assessment m -> Proxy m -> Proxy c -> c -> Log
- data HFlag_moduleLinesWarning = HFlagC_moduleLinesWarning
- flags_moduleLinesWarning :: Int
- data HFlag_moduleLinesCritical = HFlagC_moduleLinesCritical
- flags_moduleLinesCritical :: Int
- assessModuleLength :: Assessment LOC
- data HFlag_functionLinesWarning = HFlagC_functionLinesWarning
- flags_functionLinesWarning :: Int
- data HFlag_functionLinesCritical = HFlagC_functionLinesCritical
- flags_functionLinesCritical :: Int
- assessFunctionLength :: Assessment LOC
- data HFlag_functionDepthWarning = HFlagC_functionDepthWarning
- flags_functionDepthWarning :: Int
- data HFlag_functionDepthCritical = HFlagC_functionDepthCritical
- flags_functionDepthCritical :: Int
- assessFunctionDepth :: Assessment Depth
- data HFlag_functionCCWarning = HFlagC_functionCCWarning
- flags_functionCCWarning :: Int
- data HFlag_functionCCCritical = HFlagC_functionCCCritical
- flags_functionCCCritical :: Int
- assessFunctionCC :: Assessment Cyclomatic
- data HFlag_typeConDepthWarning = HFlagC_typeConDepthWarning
- flags_typeConDepthWarning :: Int
- data HFlag_typeConDepthCritical = HFlagC_typeConDepthCritical
- flags_typeConDepthCritical :: Int
- assessTypeConDepth :: Assessment ConDepth
- data HFlag_numFunArgsWarning = HFlagC_numFunArgsWarning
- flags_numFunArgsWarning :: Int
- data HFlag_numFunArgsCritical = HFlagC_numFunArgsCritical
- flags_numFunArgsCritical :: Int
- assessNumFunArgs :: Assessment NumFunArgs
- data HFlag_recordFieldsCountWarning = HFlagC_recordFieldsCountWarning
- flags_recordFieldsCountWarning :: Int
- data HFlag_recordFieldsCountCritical = HFlagC_recordFieldsCountCritical
- flags_recordFieldsCountCritical :: Int
- assessRecordFieldsCount :: Assessment RecordFieldsCount
- data HFlag_typeClassNonTypeDeclWarning = HFlagC_typeClassNonTypeDeclWarning
- flags_typeClassNonTypeDeclWarning :: Int
- data HFlag_typeClassNonTypeDeclCritical = HFlagC_typeClassNonTypeDeclCritical
- flags_typeClassNonTypeDeclCritical :: Int
- assessTCNonTypeDeclCount :: Assessment NonTypeDeclCount
- data HFlag_typeClassAssocTypesWarning = HFlagC_typeClassAssocTypesWarning
- flags_typeClassAssocTypesWarning :: Int
- data HFlag_typeClassAssocTypesCritical = HFlagC_typeClassAssocTypesCritical
- flags_typeClassAssocTypesCritical :: Int
- assessTCAssocTypesCount :: Assessment AssocTypeCount
- metrics :: [Program -> Log]
Showing metric measurements
measureAll :: Metric m c => Assessment m -> (a -> [c]) -> Proxy m -> Proxy c -> a -> Log Source #
measureTopOccurs :: (Data from, Metric m c) => Assessment m -> Proxy m -> Proxy c -> from -> Log Source #
measureAllOccurs :: (Data from, Metric m c) => Assessment m -> Proxy m -> Proxy c -> from -> Log Source #
Measure all occurences of a given CodeFragment
with a given Metric
,
then use Assessment
on them and give a list of Log
messages.
Arguments come in the following order:
1. Assessment
for the value of the Metric
.
2. Metric
given as Proxy
type.
3. CodeFragment
given as Proxy
type.
4. Program containing CodeFragment
s.
type Assessment m = m -> (Severity, String) Source #
Type of functions that convert a Metric
into a log message.
warnOfMeasure :: (CodeFragment c, Metric m c) => Assessment m -> Proxy m -> Proxy c -> c -> Log Source #
Assessments of severity for used Metric
s.
Module definition checks
data HFlag_moduleLinesWarning Source #
Instances
Flag HFlag_moduleLinesWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_moduleLinesWarning -> FlagData |
flags_moduleLinesWarning :: Int Source #
data HFlag_moduleLinesCritical Source #
Instances
Flag HFlag_moduleLinesCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_moduleLinesCritical -> FlagData |
flags_moduleLinesCritical :: Int Source #
Function definition checks
Number of lines of code within function body
data HFlag_functionLinesWarning Source #
Instances
Flag HFlag_functionLinesWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_functionLinesWarning -> FlagData |
flags_functionLinesWarning :: Int Source #
data HFlag_functionLinesCritical Source #
Instances
Flag HFlag_functionLinesCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_functionLinesCritical -> FlagData |
flags_functionLinesCritical :: Int Source #
Decision depth of function definition
data HFlag_functionDepthWarning Source #
Instances
Flag HFlag_functionDepthWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_functionDepthWarning -> FlagData |
flags_functionDepthWarning :: Int Source #
data HFlag_functionDepthCritical Source #
Instances
Flag HFlag_functionDepthCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_functionDepthCritical -> FlagData |
flags_functionDepthCritical :: Int Source #
Cyclomatic complexity of function definition
data HFlag_functionCCWarning Source #
Instances
Flag HFlag_functionCCWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_functionCCWarning -> FlagData |
flags_functionCCWarning :: Int Source #
data HFlag_functionCCCritical Source #
Instances
Flag HFlag_functionCCCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_functionCCCritical -> FlagData |
flags_functionCCCritical :: Int Source #
Type signature complexity
Type constructor depth in each type signature
data HFlag_typeConDepthWarning Source #
Instances
Flag HFlag_typeConDepthWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_typeConDepthWarning -> FlagData |
flags_typeConDepthWarning :: Int Source #
data HFlag_typeConDepthCritical Source #
Instances
Flag HFlag_typeConDepthCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_typeConDepthCritical -> FlagData |
flags_typeConDepthCritical :: Int Source #
Number of function arguments mentioned in each type signature
data HFlag_numFunArgsWarning Source #
Instances
Flag HFlag_numFunArgsWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_numFunArgsWarning -> FlagData |
flags_numFunArgsWarning :: Int Source #
data HFlag_numFunArgsCritical Source #
Instances
Flag HFlag_numFunArgsCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_numFunArgsCritical -> FlagData |
flags_numFunArgsCritical :: Int Source #
Data type complexity
Record fields count
data HFlag_recordFieldsCountWarning Source #
Instances
Flag HFlag_recordFieldsCountWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_recordFieldsCountWarning -> FlagData |
data HFlag_recordFieldsCountCritical Source #
Instances
Flag HFlag_recordFieldsCountCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_recordFieldsCountCritical -> FlagData |
Type class complexity
Method count of type class
data HFlag_typeClassNonTypeDeclWarning Source #
Instances
Flag HFlag_typeClassNonTypeDeclWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_typeClassNonTypeDeclWarning -> FlagData |
data HFlag_typeClassNonTypeDeclCritical Source #
Instances
Flag HFlag_typeClassNonTypeDeclCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_typeClassNonTypeDeclCritical -> FlagData |
Associated type count of type class
data HFlag_typeClassAssocTypesWarning Source #
Instances
Flag HFlag_typeClassAssocTypesWarning Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_typeClassAssocTypesWarning -> FlagData |
data HFlag_typeClassAssocTypesCritical Source #
Instances
Flag HFlag_typeClassAssocTypesCritical Source # | |
Defined in Language.Haskell.Homplexity.Assessment getFlagData :: HFlag_typeClassAssocTypesCritical -> FlagData |