<commit_before>//
//  PerformanceViewController.swift
//  JumuNordost
//
//  Created by <NAME> on 21/02/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import ReactiveCocoa
import Cartography

class PerformanceViewController: BaseViewController {

    private let mediator: PerformanceMediator
    private let performanceView: PerformanceView

    // MARK: - Lifecycle

    init(mediator: PerformanceMediator) {
        self.mediator = mediator
        performanceView = PerformanceView(performance: mediator.formattedPerformance)

        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    // MARK: - View Lifecycle

    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = UIColor.whiteColor()

        view.addSubview(performanceView)

        makeConstraints()
        makeBindings()
    }

    // MARK: - Layout

    private func makeConstraints() {
        performanceView.topAnchor.constraintEqualToAnchor(topLayoutGuide.bottomAnchor, constant: 16).active = true

        constrain(view, performanceView) { superview, performanceView in
            performanceView.left == superview.leftMargin
            performanceView.right == superview.rightMargin
            performanceView.bottom <= superview.bottomMargin
        }
    }

    // MARK: - Bindings

    private func makeBindings() {
        self.title = mediator.title

        mediator.active <~ isActive
    }
}
<commit_msg>Wrap performance details in scroll view to prevent visual cut-off<commit_after>//
//  PerformanceViewController.swift
//  JumuNordost
//
//  Created by <NAME> on 21/02/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import ReactiveCocoa
import Cartography

class PerformanceViewController: BaseViewController {

    private let mediator: PerformanceMediator
    private let scrollView = UIScrollView()
    private let performanceView: PerformanceView

    // MARK: - Lifecycle

    init(mediator: PerformanceMediator) {
        self.mediator = mediator
        performanceView = PerformanceView(performance: mediator.formattedPerformance)

        super.init(nibName: nil, bundle: nil)
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    // MARK: - View Lifecycle

    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = UIColor.whiteColor()

        scrollView.alwaysBounceVertical = true
        scrollView.layoutMargins = UIEdgeInsets(top: 16, left: 8, bottom: 16, right: 8)

        scrollView.addSubview(performanceView)
        view.addSubview(scrollView)

        makeConstraints()
        makeBindings()
    }

    // MARK: - Layout

    private func makeConstraints() {
        constrain(view, scrollView, performanceView) { superview, scrollView, performanceView in
            scrollView.edges == superview.edges

            performanceView.top == scrollView.topMargin
            performanceView.left == superview.leftMargin
            performanceView.right == superview.rightMargin
            performanceView.bottom == scrollView.bottomMargin
        }
    }

    // MARK: - Bindings

    private func makeBindings() {
        self.title = mediator.title

        mediator.active <~ isActive
    }
}

{'fraction_non_alphanumeric': 0.08894799054373523, 'fraction_numerical': 0.008274231678486997, 'mean_word_length': 2.7075575027382257, 'pattern_counts': {'":': 0, '<': 10, '<?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': '6983382', 'n_tokens_mistral': 978, 'n_tokens_neox': 888, 'n_words': 213}