<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Lighthouse.Web.Models.Dashboard
{
    public class Application
    {
        public string Name { get; set; }
        public string Slug { get; set; }
        public string Url { get; set; }
        public IEnumerable<Build> Builds { get; set; }

        public string GetCurrentStatus()
        {
            if (Builds != null && Builds.Any())
            {
                return Builds.First().Status.ToLower();
            }
            else
            {
                return "no builds";
            }
        }

        public TimeSpan AverageBuildTime()
        {
            var averageBuildTime = TimeSpan.Zero;

            if (Builds != null && Builds.Any())
            {
                var completedBuilds = Builds.Where(b => b.Created.HasValue && b.Deployed.HasValue);
                if (completedBuilds.Any())
                {
                    var averageBuildSeconds = completedBuilds.Average(b => (b.Deployed.Value - b.Created.Value).TotalSeconds);
                    var roundedUpAverageBuildSeconds = (int)Math.Round(averageBuildSeconds, MidpointRounding.AwayFromZero);
                    averageBuildTime = new TimeSpan(0, 0, roundedUpAverageBuildSeconds);
                }
            }
<commit_msg>Added & Removed Members in Application Model<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Lighthouse.Web.Models.Dashboard
{
    public class Application
    {
        public string Name { get; set; }
        public string Slug { get; set; }
        public string Url { get; set; }
        public IEnumerable<Build> Builds { get; set; }

        public IEnumerable<Build> GetQueuedBuilds()
        {
            if (Builds.IsNotNullOrEmpty())
            {
                return Builds.Where(b => b.Status.Equals("queued", StringComparison.OrdinalIgnoreCase));
            }
            else
            {
                return new List<Build>();
            }
        }

        public IEnumerable<Build> GetBuildingBuilds()
        {
            if (Builds.IsNotNullOrEmpty())
            {
                return Builds.Where(b => b.Status.Equals("building", StringComparison.OrdinalIgnoreCase));
            }
            else
            {
                return new List<Build>();
            }
        }

        public IEnumerable<Build> GetCompletedBuilds()
        {
            if (Builds.IsNotNullOrEmpty())
            {
                return Builds.Where(b => b.Status.Equals("succeeded", StringComparison.OrdinalIgnoreCase) ||
                    b.Status.Equals("failed", StringComparison.OrdinalIgnoreCase));
            }
            else
            {
                return new List<Build>();
            }
        }

        public TimeSpan AverageBuildTime()
        {
            var averageBuildTime = TimeSpan.Zero;

            if (Builds.IsNotNullOrEmpty())
            {
                var completedBuilds = Builds.Where(b => b.Created.HasValue && b.Deployed.HasValue);
                if (completedBuilds.Any())
                {
                    var averageBuildSeconds = completedBuilds.Average(b => (b.Deployed.Value - b.Created.Value).TotalSeconds);
                    var roundedUpAverageBuildSeconds = (int)Math.Round(averageBuildSeconds, MidpointRounding.AwayFromZero);
                    averageBuildTime = new TimeSpan(0, 0, roundedUpAverageBuildSeconds);
                }
            }

{'fraction_non_alphanumeric': 0.09621896162528217, 'fraction_numerical': 0.001128668171557562, 'mean_word_length': 1.655430711610487, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 18, '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': '7050420', 'n_tokens_mistral': 933, 'n_tokens_neox': 892, 'n_words': 185}