<commit_before>//
//  BusinessDetailsViewController.swift
//  LaDalle
//
//  Created by <NAME> on 9/16/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
import MapKit

class BusinessDetailsViewController: UIViewController {
    
    var business: Business?
    
    @IBOutlet weak var businessMapView: MKMapView!

    @IBOutlet weak var businessNameLabel: UILabel!
    @IBOutlet weak var businessReviewImageView: UIImageView!
    @IBOutlet weak var businessReviewCountLabel: UILabel!
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        guard let business = business else { return }
        
        //let businessDetails = Business.getDetails(for: business)
        businessNameLabel.text = business.name
        //businessImageView.image = business.loadImage(from: business.imageUrl)
//        if let image = Business.getImage(from: business.imageUrl) {
//            businessImageView.image = image
//        }
        
        var ratingImageName = "rating0"
        
        switch business.rating {
        case 5:
            ratingImageName = "rating50"
        case 4.5:
            ratingImageName = "rating45"
        case 4:
            ratingImageName = "rating40"
        case 3.5:
            ratingImageName = "rating35"
        case 3:
            ratingImageName = "rating30"
        case 2.5:
            ratingImageName = "rating25"
        case 2:
            ratingImageName = "rating20"
        case 1.5:
            ratingImageName = "rating15"
        case 1:
            ratingImageName = "rating10"
        default:
            break
        }
        
        businessReviewImageView.image = UIImage(named: ratingImageName)
        
        //businessReviewImageView.image
        businessReviewCountLabel.text = "Based on " + String(business.reviewCount) + " reviews."
        
        // Do any additional setup after loading the view.
    }
    
        
}
<commit_msg>Cleanup business details functions<commit_after>//
//  BusinessDetailsViewController.swift
//  LaDalle
//
//  Created by <NAME> on 9/16/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import UIKit
import MapKit

class BusinessDetailsViewController: UIViewController {
    
    var business: Business?
    
    @IBOutlet weak var businessMapView: MKMapView!

    @IBOutlet weak var businessNameLabel: UILabel!
    @IBOutlet weak var businessReviewImageView: UIImageView!
    @IBOutlet weak var businessReviewCountLabel: UILabel!
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        populateBusinessInfo()
        
    }
    
    func populateBusinessInfo() {
        
        guard let business = business else { return }
        businessNameLabel.text = business.name
        
        let ratingImageName = Business.getRatingImage(rating: business.rating)
        businessReviewImageView.image = UIImage(named: ratingImageName)
        
        //businessReviewImageView.image
        businessReviewCountLabel.text = "Based on " + String(business.reviewCount) + " reviews."
        
    }
    
}

{'fraction_non_alphanumeric': 0.08041170794467674, 'fraction_numerical': 0.01608234158893535, 'mean_word_length': 2.067061143984221, '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': '6265810', 'n_tokens_mistral': 886, 'n_tokens_neox': 829, 'n_words': 207}