• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FAIRsharing / fairsharing.github.io / 24769584990

22 Apr 2026 08:57AM UTC coverage: 95.892% (-4.1%) from 100.0%
24769584990

push

github

web-flow
Merge pull request #2746 from FAIRsharing/dev

Dev

3653 of 3813 branches covered (95.8%)

Branch coverage included in aggregate %.

17344 of 18229 new or added lines in 282 files covered. (95.15%)

766 existing lines in 50 files now uncovered.

38617 of 40268 relevant lines covered (95.9%)

5.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.87
/src/components/Home/StatisticsBlock.vue
1
<template>
2
  <v-container>
1✔
3
    <v-row class="block-category">
1✔
4
      <v-col cols="12" sm="12" md="4" lg="4">
1✔
5
        <v-card
1✔
6
          class="mx-auto block-category__card d-flex flex-column"
1✔
7
          max-width="350"
1✔
8
          height="100%"
1✔
9
        >
10
          <v-card-title
1✔
11
            class="d-inline counter text-h2 font-weight-bold"
1✔
12
            :data-target="statsData.resources"
1✔
13
          />
1✔
14
          <v-card-subtitle class="text--primary mt-0 text-h6 font-weight-bold">
1✔
15
            {{ statisticsData.firstColumn.title }}
1✔
16
          </v-card-subtitle>
1✔
17
          <v-card-text class="text--primary">
1✔
18
            {{ statisticsData.firstColumn.description }}
1✔
19
          </v-card-text>
1✔
20
        </v-card>
1✔
21
      </v-col>
1✔
22
      <v-col cols="12" sm="12" md="4" lg="4">
1✔
23
        <v-card
1✔
24
          class="mx-auto block-category__card d-flex flex-column"
1✔
25
          max-width="350"
1✔
26
          height="100%"
1✔
27
        >
28
          <v-card-title
1✔
29
            class="d-inline counter text-h2 font-weight-bold"
1✔
30
            :data-target="statsData.contributors"
1✔
31
          />
1✔
32
          <v-card-subtitle class="text--primary mt-0 text-h6 font-weight-bold">
1✔
33
            {{ statisticsData.secondColumn.title }}
1✔
34
          </v-card-subtitle>
1✔
35
          <v-card-text class="text--primary">
1✔
36
            {{ statisticsData.secondColumn.description }}
1✔
37
          </v-card-text>
1✔
38
        </v-card>
1✔
39
      </v-col>
1✔
40
      <v-col cols="12" sm="12" md="4" lg="4">
1✔
41
        <v-card
1✔
42
          class="mx-auto block-category__card d-flex flex-column"
1✔
43
          max-width="350"
1✔
44
          height="100%"
1✔
45
        >
46
          <v-card-title
1✔
47
            class="d-inline counter text-h2 font-weight-bold"
1✔
48
            :data-target="statsData.views"
1✔
49
          />
1✔
50
          <v-card-subtitle class="text--primary mt-0 text-h6 font-weight-bold">
1✔
51
            {{ statisticsData.thirdColumn.title }}
1✔
52
          </v-card-subtitle>
1✔
53
          <v-card-text class="text--primary">
1✔
54
            {{ statisticsData.thirdColumn.description }}
1✔
55
          </v-card-text>
1✔
56
        </v-card>
1✔
57
      </v-col>
1✔
58
    </v-row>
1✔
59
  </v-container>
1✔
60
</template>
61

62
<script>
63
import homePageData from "@/data/homePageData.json";
1✔
64
import RestClient from "@/lib/Client/RESTClient.js";
1✔
65
import { truncate } from "@/utils/stringUtils";
1✔
66

67
const restClient = new RestClient();
1✔
68

69
export default {
1✔
70
  name: "StatisticsBlock",
1✔
71
  mixins: [truncate],
1✔
72
  data() {
1✔
73
    return {
2✔
74
      statsData: {
2✔
75
        contributors: 1,
2✔
76
        resources: 1,
2✔
77
        views: 1,
2✔
78
      },
2✔
79
      blockCategories: homePageData.blockCategories,
2✔
80
      statisticsData: homePageData.statisticsData,
2✔
81
    };
2✔
82
  },
1✔
83

84
  mounted() {
1✔
85
    this.getStatisticsCount();
2✔
86
  },
1✔
87
  methods: {
1✔
88
    async getStatisticsCount() {
1✔
89
      this.statsData = await restClient.getStatisticsData();
4✔
90
      this.updateStaticsData();
4✔
91
    },
1✔
92
    updateStaticsData() {
1✔
93
      const counters = this.$el.querySelectorAll(".counter");
4✔
94
      const speed = 200;
4✔
95

96
      counters.forEach((counter) => {
4✔
UNCOV
97
        counter.innerText = 0;
×
UNCOV
98
        const updateCounter = () => {
×
UNCOV
99
          const target = +counter.getAttribute("data-target");
×
UNCOV
100
          const count = +counter.innerText;
×
UNCOV
101
          const increment = target / speed;
×
UNCOV
102
          if (count < target) {
×
UNCOV
103
            counter.innerText = Math.ceil(count + increment);
×
UNCOV
104
            setTimeout(updateCounter, 1);
×
UNCOV
105
          } else {
×
NEW
106
            counter.innerText = this.updateNumbers(target);
×
UNCOV
107
          }
×
UNCOV
108
        };
×
UNCOV
109
        updateCounter();
×
110
      });
4✔
111
    },
1✔
112
    updateNumbers(labelValue) {
1✔
UNCOV
113
      // Nine Zeroes for Billions
×
NEW
114
      if (labelValue >= 1.0e9) {
×
NEW
115
        return Math.round(Number(labelValue) / 1.0e9) + "B";
×
UNCOV
116
      }
×
UNCOV
117
      // Six Zeroes for Millions
×
NEW
118
      else if (labelValue >= 1.0e6) {
×
NEW
119
        return Math.round(Number(labelValue) / 1.0e6) + "M";
×
UNCOV
120
      }
×
UNCOV
121
      // Three Zeroes for Thousands
×
NEW
122
      else if (labelValue >= 1.0e4) {
×
NEW
123
        return Math.round(Number(labelValue) / 1.0e3) + "K";
×
NEW
124
      } else {
×
NEW
125
        return labelValue;
×
UNCOV
126
      }
×
127
    },
1✔
128
  },
1✔
129
};
1✔
130
</script>
131

132
<style scoped>
133
#container-wrp {
134
  text-align: center;
135
  margin: 0 auto;
136
  color: white;
137
}
138
</style>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc