<commit_before>port module App exposing (..)

{-| A web app for finding broken links.
-}

import Model exposing (..)
import Msg exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Layout exposing (..)
import String


main : Program (Maybe Model)
main =
  App.programWithFlags
  { init = appInit
  , view = appView
  , update = appUpdate
  , subscriptions = \_ -> Sub.none
  }


appInit : Maybe Model -> ( Model, Cmd Msg )
appInit _ =
  emptyModel ! []


appUpdate : Msg -> Model -> ( Model, Cmd Msg )
appUpdate msg model =
  case msg of
    NoOp ->
      model ! []

    UpdateFormUrl url ->
      { model
      | form = { url = url } -- NOTE: elm parser barfs on { model.form | url = url }
      } ! []

    StartScanning -> -- TODO do stuff
      { model
      | isScanning = True
      , siteMap = [ { url = model.form.url, outgoingLinks = [] } ]
      } ! []


appView : Model -> Html Msg
appView model =
  div [ class "container" ]
    ( [ Layout.header
       , Layout.form model
      ] ++
      Layout.results model ++
      [ Layout.footer ]
    )
<commit_msg>address Msg by module<commit_after>port module App exposing (..)

{-| A web app for finding broken links.
-}

import Model exposing (..)
import Msg
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Layout
import String


main : Program (Maybe Model)
main =
  App.programWithFlags
  { init = appInit
  , view = appView
  , update = appUpdate
  , subscriptions = \_ -> Sub.none
  }


appInit : Maybe Model -> ( Model, Cmd Msg.Msg )
appInit _ = Model.emptyModel ! []


appUpdate : Msg.Msg -> Model -> ( Model, Cmd Msg.Msg )
appUpdate msg model =
  case msg of
    Msg.NoOp ->
      model ! []

    Msg.UpdateFormUrl url ->
      { model
      | form = { url = url } -- NOTE: elm parser barfs on { model.form | url = url }
      } ! []

    Msg.StartScanning -> -- TODO do stuff
      { model
      | isScanning = True
      , siteMap = [ { url = model.form.url, outgoingLinks = [] } ]
      } ! []


appView : Model -> Html Msg.Msg
appView model =
  div [ class "container" ]
    ( [ Layout.header
       , Layout.form model
      ] ++
      Layout.results model ++
      [ Layout.footer ]
    )

{'fraction_non_alphanumeric': 0.12743362831858407, 'fraction_numerical': 0.0, 'mean_word_length': 2.184507042253521, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2425024', 'n_tokens_mistral': 752, 'n_tokens_neox': 722, 'n_words': 217}