<commit_before>//
//  AboutRepositoryTableViewController.swift
//  pass
//
//  Created by <NAME> on 9/2/2017.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class AboutRepositoryTableViewController: BasicStaticTableViewController {

    override func viewDidLoad() {
        navigationItemTitle = "About Repository"
        super.viewDidLoad()
        let passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
        let fm = FileManager.default
        var size = UInt64(0)
        do {
            size = try fm.allocatedSizeOfDirectoryAtURL(directoryURL: PasswordStore.shared.storeURL)
        } catch {
            print(error)
        }
        let formatted = ByteCountFormatter.string(fromByteCount: Int64(size), countStyle: ByteCountFormatter.CountStyle.file)
        tableData = [
            // section 0
            [[.type: CellDataType.detail, .title: "Passwords", .detailText: String(passwordEntities.count)],
             [.type: CellDataType.detail, .title: "Size", .detailText: formatted],
             [.type: CellDataType.detail, .title: "Last Synced", .detailText: Utils.getLastUpdatedTimeString()],
             ],
        ]
        tableView.reloadData()
    }

}<commit_msg>async calculating about repository page<commit_after>//
//  AboutRepositoryTableViewController.swift
//  pass
//
//  Created by <NAME> on 9/2/2017.
//  Copyright © 2017 <NAME>. All rights reserved.
//

import UIKit

class AboutRepositoryTableViewController: BasicStaticTableViewController {

    override func viewDidLoad() {
        navigationItemTitle = "About Repository"
        super.viewDidLoad()
        let indicatorLable = UILabel(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 21))
        indicatorLable.center = CGPoint(x: view.frame.size.width / 2, y: view.frame.size.height * 0.382 + 22)
        indicatorLable.backgroundColor = UIColor.clear
        indicatorLable.textColor = UIColor.gray
        indicatorLable.text = "calculating"
        indicatorLable.textAlignment = .center
        indicatorLable.font = UIFont.preferredFont(forTextStyle: .footnote)
        let indicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
        indicator.center = CGPoint(x: view.frame.size.width / 2, y: view.frame.size.height * 0.382)
        indicator.startAnimating()
        tableView.addSubview(indicator)
        tableView.addSubview(indicatorLable)
        
        DispatchQueue.global(qos: .userInitiated).async {
            let passwordEntities = PasswordStore.shared.fetchPasswordEntityCoreData()
            let fm = FileManager.default
            var size = UInt64(0)
            do {
                size = try fm.allocatedSizeOfDirectoryAtURL(directoryURL: PasswordStore.shared.storeURL)
            } catch {
                print(error)
            }

            DispatchQueue.main.async { [weak self] in
                let formatted = ByteCountFormatter.string(fromByteCount: Int64(size), countStyle: ByteCountFormatter.CountStyle.file)
                self?.tableData = [
                    // section 0
                    [[.type: CellDataType.detail, .title: "Passwords", .detailText: String(passwordEntities.count)],
                     [.type: CellDataType.detail, .title: "Size", .detailText: formatted],
                     [.type: CellDataType.detail, .title: "Last Synced", .detailText: Utils.getLastUpdatedTimeString()],
                     ],
                ]
                indicator.stopAnimating()
                indicatorLable.isHidden = true
                self?.tableView.reloadData()
            }
        }
    }

}
{'fraction_non_alphanumeric': 0.10283981251723187, 'fraction_numerical': 0.013234077750206782, 'mean_word_length': 2.3406998158379375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7484571', 'n_tokens_mistral': 1038, 'n_tokens_neox': 982, 'n_words': 201}