Skip to content

Commit

Permalink
chore: deleted activity analysis from hipcheck core
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarr-mitre committed Nov 14, 2024
1 parent 91181eb commit cdbf4bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 81 deletions.
12 changes: 1 addition & 11 deletions hipcheck/src/analysis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ use std::{
pub trait AnalysisProvider:
AttacksConfigQuery + CommitConfigQuery + GitProvider + MetricProvider + PracticesConfigQuery
{
/// Returns result of activity analysis
fn activity_analysis(&self) -> Result<QueryResult>;


/// Returns result of affiliation analysis
fn affiliation_analysis(&self) -> Result<QueryResult>;

Expand All @@ -50,14 +48,6 @@ pub trait AnalysisProvider:
fn typo_analysis(&self) -> Result<QueryResult>;
}

pub fn activity_analysis(db: &dyn AnalysisProvider) -> Result<QueryResult> {
let results = db.activity_metric()?;
let value = results.time_since_last_commit.num_weeks() as u64;
Ok(QueryResult {
value: serde_json::to_value(value)?,
concerns: vec![],
})
}

pub fn affiliation_analysis(db: &dyn AnalysisProvider) -> Result<QueryResult> {
let results = db.affiliation_metric()?;
Expand Down
64 changes: 0 additions & 64 deletions hipcheck/src/metric/activity.rs

This file was deleted.

8 changes: 2 additions & 6 deletions hipcheck/src/metric/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: Apache-2.0

pub mod activity;
pub mod affiliation;
pub mod binary;
pub mod binary_detector;
Expand All @@ -20,7 +19,7 @@ use crate::{
data::{git::GitProvider, DependenciesProvider, FuzzProvider, PullRequestReviewProvider},
error::Result,
metric::{
activity::ActivityOutput, affiliation::AffiliationOutput, binary::BinaryOutput,
affiliation::AffiliationOutput, binary::BinaryOutput,
binary_detector::BinaryFile, churn::ChurnOutput, commit_trust::CommitTrustOutput,
contributor_trust::ContributorTrustOutput, entropy::EntropyOutput, fuzz::FuzzOutput,
identity::IdentityOutput, linguist::Linguist, review::ReviewOutput, typo::TypoOutput,
Expand All @@ -40,10 +39,7 @@ pub trait MetricProvider:
+ FuzzProvider
+ PullRequestReviewProvider
{
/// Returns result of activity metric
#[salsa::invoke(activity::activity_metric)]
fn activity_metric(&self) -> Result<Arc<ActivityOutput>>;


/// Returns result of affiliation metric
#[salsa::invoke(affiliation::affiliation_metric)]
fn affiliation_metric(&self) -> Result<Arc<AffiliationOutput>>;
Expand Down

0 comments on commit cdbf4bf

Please sign in to comment.