-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Measure your code's complexity -- -- Argon performs static analysis on your code in order to compute -- cyclomatic complexity. It is a quantitative measure of the number of -- linearly indipendent paths through the code. -- -- The intended usage is through Argon's executable, which accepts a list -- of file paths to analyze. The data can be optionally exported to JSON. @package argon @version 0.2.0.0 -- | Programmatic interface to Argon. module Argon -- | Represent the result of the analysis of one file. It can either be an -- error message or a list of ComplexityBlocks. type AnalysisResult = Either String [ComplexityBlock] -- | Hold the data associated to a function binding: (line number, column, -- function name, complexity). newtype ComplexityBlock CC :: (Int, Int, String, Int) -> ComplexityBlock -- | Type describing how the results should be exported. data OutputMode -- | Text-only output, no colors. BareText :: OutputMode -- | Text-only output, with colors. Colored :: OutputMode -- | Data is serialized to JSON. JSON :: OutputMode -- | Type holding all the options passed from the command line. data Config Config :: Int -> OutputMode -> Config -- | Minimum complexity a block has to have to be shown in results. [minCC] :: Config -> Int -- | Describe how the results should be exported. [outputMode] :: Config -> OutputMode -- | Parse the given code and compute cyclomatic complexity for every -- function binding. parseCode :: Maybe String -> String -> IO (FilePath, AnalysisResult) -- | Order a list of blocks. Ordering is done with respect to: -- --
    --
  1. complexity (descending)
  2. --
  3. line number (ascending)
  4. --
  5. function name (alphabetically)
  6. --
order :: [ComplexityBlock] -> [ComplexityBlock] -- | Filter the results of the analysis, with respect to the given -- ResultsOptions. filterResults :: Config -> (FilePath, AnalysisResult) -> (FilePath, AnalysisResult) -- | Export analysis' results. How to export the data is defined by the -- ResultsOptions. export :: Config -> [(FilePath, AnalysisResult)] -> String