Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to counting lines when metrics fail ft 5698 #103

Merged

Conversation

bmbferreira
Copy link
Contributor

No description provided.

@bmbferreira
Copy link
Contributor Author

this PR depends on this: #105

@bmbferreira bmbferreira force-pushed the fallback_to_counting_lines_when_metrics_fail_FT-5698 branch 3 times, most recently from 2c8f5d8 to 96977d6 Compare September 6, 2018 17:01
@codacy codacy deleted a comment Sep 6, 2018
}(collection.breakOut)
}

fileMetrics.foreach(results => formatter.addAll(results.to[List]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

calculateMissingFileMetrics doing the formatter does not seem a nice thing.


val analysisFiles: Set[Path] = metricsResults.flatMap(_.files)(collection.breakOut)

metricsResults.map { res =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try something like

forEach file
  getMetrics
    case None => FileMetrics(loc = calculateLoc)
    case Some(metrics) if metrics.loc.isEmpty => FileMetrics(loc = calculateLoc)
    case Some(metrics) => metrics

analysisResultsWithMissingMetrics
}

private def reduceAndCalculateMissingFileMetrics(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to put this inside some post processing logic and then perform the reduce, missing and format inside.

@bmbferreira
Copy link
Contributor Author

This PR depends on this: #107

@bmbferreira bmbferreira force-pushed the fallback_to_counting_lines_when_metrics_fail_FT-5698 branch from 9b4b1be to 851b9f3 Compare September 10, 2018 08:56
@bmbferreira bmbferreira force-pushed the fallback_to_counting_lines_when_metrics_fail_FT-5698 branch from 851b9f3 to 7d1a822 Compare September 10, 2018 09:05
@rtfpessoa rtfpessoa merged commit f7df160 into master Sep 10, 2018
@rtfpessoa rtfpessoa deleted the fallback_to_counting_lines_when_metrics_fail_FT-5698 branch September 10, 2018 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants