-- 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.3.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: (location, -- function name, complexity). newtype ComplexityBlock CC :: (Loc, 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 -- | Type synonym representing a portion of the source code. The tuple -- represents the following: (start line, start col, end line, end -- col). type Loc = (Int, Int) -- | Parse the code in the given filename and compute cyclomatic complexity -- for every function binding. analyze :: FilePath -> IO (FilePath, AnalysisResult) -- | Parse a module with the default instructions for the C pre-processor parseModule :: FilePath -> IO (Either String LModule) -- | 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 -- Config. filterResults :: Config -> (FilePath, AnalysisResult) -> (FilePath, AnalysisResult) -- | Export analysis' results. How to export the data is defined by the -- Config parameter. export :: Config -> [(FilePath, AnalysisResult)] -> String