This removes api authentification with token in favor of signature method. Refactorize code and clean up. It add more unit test plus code coverage in test/converage. - Added config.api.timestampTimeout - Added Helper::signRequest This calculates the request signature - Added more unit tests and extend code coverage. - Added rate limiter for web routes - Added RemoveSpaces Sanitizer on api requests - Added stress test suite - Changed AuthServiceProvider api-token to api-hmac - Changed CustomerSeeder to have at least of customer activated (for unit tests) - Changed used transation for saveing multiple models - Changed, in ServiceController generateApiToken to generateServicePassword - Changed, timestamp has to be send in request with a DateTime format, it also has to a UTC value - Composer added brianium/paratest - Composer update - Fixed case where removing single optin could be the wrong one (not for the good service) - Fixed customer delete - Fixed customer would not be resolved by brand. - Fixed Really check that request is json checking body content, preventing sending malformed requests - Remove ApiError::needAuth - Removed api_token - Removed ApiController::authenticate - Removed config.api.tokenTimeout - Removed Header check or usage because of HAProxy doing weird stuff - Removed lock files from gitignore - Removed memcached dependency - Removed unused questions resources api routes - Removed workspace file Migrations - Added unique index on services.bearer_token - Changed customer_id on customer_answer is nullable - Changed services.bearer_pwd length to 312 (the size of the token) - Dropped services.api_token and service.api_token_date
294 lines
12 KiB
HTML
294 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Dashboard for /home/jeremy/projets/crm/app/Http/Requests/Api</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link href="../../../_css/bootstrap.min.css" rel="stylesheet" type="text/css">
|
|
<link href="../../../_css/nv.d3.min.css" rel="stylesheet" type="text/css">
|
|
<link href="../../../_css/style.css" rel="stylesheet" type="text/css">
|
|
<link href="../../../_css/custom.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<nav aria-label="breadcrumb">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="../../../index.html">/home/jeremy/projets/crm/app</a></li>
|
|
<li class="breadcrumb-item"><a href="../../index.html">Http</a></li>
|
|
<li class="breadcrumb-item"><a href="../index.html">Requests</a></li>
|
|
<li class="breadcrumb-item"><a href="index.html">Api</a></li>
|
|
<li class="breadcrumb-item active">(Dashboard)</li>
|
|
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<h2>Classes</h2>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h3>Coverage Distribution</h3>
|
|
<div id="classCoverageDistribution" style="height: 300px;">
|
|
<svg></svg>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h3>Complexity</h3>
|
|
<div id="classComplexity" style="height: 300px;">
|
|
<svg></svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h3>Insufficient Coverage</h3>
|
|
<div class="scrollbox">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Class</th>
|
|
<th class="text-right">Coverage</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr><td><a href="V2/GetQuestionStatsRequest.php.html#10">App\Http\Requests\Api\V2\GetQuestionStatsRequest</a></td><td class="text-right">77%</td></tr>
|
|
<tr><td><a href="V2/StoreCustomerAnswers.php.html#8">App\Http\Requests\Api\V2\StoreCustomerAnswers</a></td><td class="text-right">89%</td></tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h3>Project Risks</h3>
|
|
<div class="scrollbox">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Class</th>
|
|
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr><td><a href="V2/GetQuestionStatsRequest.php.html#10">App\Http\Requests\Api\V2\GetQuestionStatsRequest</a></td><td class="text-right">4</td></tr>
|
|
<tr><td><a href="V2/StoreCustomerAnswers.php.html#8">App\Http\Requests\Api\V2\StoreCustomerAnswers</a></td><td class="text-right">3</td></tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<h2>Methods</h2>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h3>Coverage Distribution</h3>
|
|
<div id="methodCoverageDistribution" style="height: 300px;">
|
|
<svg></svg>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h3>Complexity</h3>
|
|
<div id="methodComplexity" style="height: 300px;">
|
|
<svg></svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h3>Insufficient Coverage</h3>
|
|
<div class="scrollbox">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Method</th>
|
|
<th class="text-right">Coverage</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr><td><a href="V2/GetQuestionStatsRequest.php.html#19"><abbr title="App\Http\Requests\Api\V2\GetQuestionStatsRequest::rules">rules</abbr></a></td><td class="text-right">77%</td></tr>
|
|
<tr><td><a href="V2/StoreCustomerAnswers.php.html#15"><abbr title="App\Http\Requests\Api\V2\StoreCustomerAnswers::rules">rules</abbr></a></td><td class="text-right">89%</td></tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h3>Project Risks</h3>
|
|
<div class="scrollbox">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Method</th>
|
|
<th class="text-right"><abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr><td><a href="V2/GetQuestionStatsRequest.php.html#19"><abbr title="App\Http\Requests\Api\V2\GetQuestionStatsRequest::rules">rules</abbr></a></td><td class="text-right">4</td></tr>
|
|
<tr><td><a href="V2/StoreCustomerAnswers.php.html#15"><abbr title="App\Http\Requests\Api\V2\StoreCustomerAnswers::rules">rules</abbr></a></td><td class="text-right">3</td></tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
<hr/>
|
|
<p>
|
|
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 9.2.10</a> using <a href="https://secure.php.net/" target="_top">PHP 7.3.31-2+ubuntu20.04.1+deb.sury.org+1</a> and <a href="https://phpunit.de/">PHPUnit 9.5.11</a> at Thu Jan 6 12:10:34 CET 2022.</small>
|
|
</p>
|
|
</footer>
|
|
</div>
|
|
<script src="../../../_js/jquery.min.js" type="text/javascript"></script>
|
|
<script src="../../../_js/d3.min.js" type="text/javascript"></script>
|
|
<script src="../../../_js/nv.d3.min.js" type="text/javascript"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
nv.addGraph(function() {
|
|
var chart = nv.models.multiBarChart();
|
|
chart.tooltips(false)
|
|
.showControls(false)
|
|
.showLegend(false)
|
|
.reduceXTicks(false)
|
|
.staggerLabels(true)
|
|
.yAxis.tickFormat(d3.format('d'));
|
|
|
|
d3.select('#classCoverageDistribution svg')
|
|
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,1,1,0,8], "Class Coverage"))
|
|
.transition().duration(500).call(chart);
|
|
|
|
nv.utils.windowResize(chart.update);
|
|
|
|
return chart;
|
|
});
|
|
|
|
nv.addGraph(function() {
|
|
var chart = nv.models.multiBarChart();
|
|
chart.tooltips(false)
|
|
.showControls(false)
|
|
.showLegend(false)
|
|
.reduceXTicks(false)
|
|
.staggerLabels(true)
|
|
.yAxis.tickFormat(d3.format('d'));
|
|
|
|
d3.select('#methodCoverageDistribution svg')
|
|
.datum(getCoverageDistributionData([0,0,0,0,0,0,0,0,1,1,0,16], "Method Coverage"))
|
|
.transition().duration(500).call(chart);
|
|
|
|
nv.utils.windowResize(chart.update);
|
|
|
|
return chart;
|
|
});
|
|
|
|
function getCoverageDistributionData(data, label) {
|
|
var labels = [
|
|
'0%',
|
|
'0-10%',
|
|
'10-20%',
|
|
'20-30%',
|
|
'30-40%',
|
|
'40-50%',
|
|
'50-60%',
|
|
'60-70%',
|
|
'70-80%',
|
|
'80-90%',
|
|
'90-100%',
|
|
'100%'
|
|
];
|
|
var values = [];
|
|
$.each(labels, function(key) {
|
|
values.push({x: labels[key], y: data[key]});
|
|
});
|
|
|
|
return [
|
|
{
|
|
key: label,
|
|
values: values,
|
|
color: "#4572A7"
|
|
}
|
|
];
|
|
}
|
|
nv.addGraph(function() {
|
|
var chart = nv.models.scatterChart()
|
|
.showDistX(true)
|
|
.showDistY(true)
|
|
.showLegend(false)
|
|
.forceX([0, 100]);
|
|
chart.tooltipContent(function(graph) {
|
|
return '<p>' + graph.point.class + '</p>';
|
|
});
|
|
|
|
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
|
chart.yAxis.axisLabel('Cyclomatic Complexity');
|
|
|
|
d3.select('#classComplexity svg')
|
|
.datum(getComplexityData([[100,2,"<a href=\"V2\/AuthenticateRequest.php.html#5\">App\\Http\\Requests\\Api\\V2\\AuthenticateRequest<\/a>"],[100,1,"<a href=\"V2\/BaseApiRequest.php.html#14\">App\\Http\\Requests\\Api\\V2\\BaseApiRequest<\/a>"],[100,4,"<a href=\"V2\/GetBrandStatsRequest.php.html#9\">App\\Http\\Requests\\Api\\V2\\GetBrandStatsRequest<\/a>"],[77.77777777777779,4,"<a href=\"V2\/GetQuestionStatsRequest.php.html#10\">App\\Http\\Requests\\Api\\V2\\GetQuestionStatsRequest<\/a>"],[100,3,"<a href=\"V2\/SendArchadiaDefaultMailRequest.php.html#11\">App\\Http\\Requests\\Api\\V2\\SendArchadiaDefaultMailRequest<\/a>"],[100,3,"<a href=\"V2\/SendArchadiaGameMailRequest.php.html#8\">App\\Http\\Requests\\Api\\V2\\SendArchadiaGameMailRequest<\/a>"],[100,1,"<a href=\"V2\/SingleOptinRequest.php.html#5\">App\\Http\\Requests\\Api\\V2\\SingleOptinRequest<\/a>"],[89.47368421052632,3,"<a href=\"V2\/StoreCustomerAnswers.php.html#8\">App\\Http\\Requests\\Api\\V2\\StoreCustomerAnswers<\/a>"],[100,2,"<a href=\"V2\/StoreCustomerRequest.php.html#9\">App\\Http\\Requests\\Api\\V2\\StoreCustomerRequest<\/a>"],[100,2,"<a href=\"V2\/UpdateCustomerRequest.php.html#9\">App\\Http\\Requests\\Api\\V2\\UpdateCustomerRequest<\/a>"]], 'Class Complexity'))
|
|
.transition()
|
|
.duration(500)
|
|
.call(chart);
|
|
|
|
nv.utils.windowResize(chart.update);
|
|
|
|
return chart;
|
|
});
|
|
|
|
nv.addGraph(function() {
|
|
var chart = nv.models.scatterChart()
|
|
.showDistX(true)
|
|
.showDistY(true)
|
|
.showLegend(false)
|
|
.forceX([0, 100]);
|
|
chart.tooltipContent(function(graph) {
|
|
return '<p>' + graph.point.class + '</p>';
|
|
});
|
|
|
|
chart.xAxis.axisLabel('Code Coverage (in percent)');
|
|
chart.yAxis.axisLabel('Method Complexity');
|
|
|
|
d3.select('#methodComplexity svg')
|
|
.datum(getComplexityData([[100,1,"<a href=\"V2\/AuthenticateRequest.php.html#12\">App\\Http\\Requests\\Api\\V2\\AuthenticateRequest::authorize<\/a>"],[100,1,"<a href=\"V2\/AuthenticateRequest.php.html#22\">App\\Http\\Requests\\Api\\V2\\AuthenticateRequest::rules<\/a>"],[100,1,"<a href=\"V2\/BaseApiRequest.php.html#39\">App\\Http\\Requests\\Api\\V2\\BaseApiRequest::authorize<\/a>"],[100,0,"<a href=\"V2\/BaseApiRequest.php.html#49\">App\\Http\\Requests\\Api\\V2\\BaseApiRequest::rules<\/a>"],[100,4,"<a href=\"V2\/GetBrandStatsRequest.php.html#18\">App\\Http\\Requests\\Api\\V2\\GetBrandStatsRequest::rules<\/a>"],[77.77777777777779,4,"<a href=\"V2\/GetQuestionStatsRequest.php.html#19\">App\\Http\\Requests\\Api\\V2\\GetQuestionStatsRequest::rules<\/a>"],[100,1,"<a href=\"V2\/SendArchadiaDefaultMailRequest.php.html#41\">App\\Http\\Requests\\Api\\V2\\SendArchadiaDefaultMailRequest::rules<\/a>"],[100,1,"<a href=\"V2\/SendArchadiaDefaultMailRequest.php.html#71\">App\\Http\\Requests\\Api\\V2\\SendArchadiaDefaultMailRequest::attributes<\/a>"],[100,1,"<a href=\"V2\/SendArchadiaDefaultMailRequest.php.html#98\">App\\Http\\Requests\\Api\\V2\\SendArchadiaDefaultMailRequest::messages<\/a>"],[100,1,"<a href=\"V2\/SendArchadiaGameMailRequest.php.html#39\">App\\Http\\Requests\\Api\\V2\\SendArchadiaGameMailRequest::rules<\/a>"],[100,1,"<a href=\"V2\/SendArchadiaGameMailRequest.php.html#65\">App\\Http\\Requests\\Api\\V2\\SendArchadiaGameMailRequest::attributes<\/a>"],[100,1,"<a href=\"V2\/SendArchadiaGameMailRequest.php.html#91\">App\\Http\\Requests\\Api\\V2\\SendArchadiaGameMailRequest::messages<\/a>"],[100,1,"<a href=\"V2\/SingleOptinRequest.php.html#12\">App\\Http\\Requests\\Api\\V2\\SingleOptinRequest::rules<\/a>"],[89.47368421052632,3,"<a href=\"V2\/StoreCustomerAnswers.php.html#15\">App\\Http\\Requests\\Api\\V2\\StoreCustomerAnswers::rules<\/a>"],[100,1,"<a href=\"V2\/StoreCustomerRequest.php.html#16\">App\\Http\\Requests\\Api\\V2\\StoreCustomerRequest::rules<\/a>"],[100,1,"<a href=\"V2\/StoreCustomerRequest.php.html#72\">App\\Http\\Requests\\Api\\V2\\StoreCustomerRequest::messages<\/a>"],[100,1,"<a href=\"V2\/UpdateCustomerRequest.php.html#16\">App\\Http\\Requests\\Api\\V2\\UpdateCustomerRequest::rules<\/a>"],[100,1,"<a href=\"V2\/UpdateCustomerRequest.php.html#81\">App\\Http\\Requests\\Api\\V2\\UpdateCustomerRequest::messages<\/a>"]], 'Method Complexity'))
|
|
.transition()
|
|
.duration(500)
|
|
.call(chart);
|
|
|
|
nv.utils.windowResize(chart.update);
|
|
|
|
return chart;
|
|
});
|
|
|
|
function getComplexityData(data, label) {
|
|
var values = [];
|
|
$.each(data, function(key) {
|
|
var value = Math.round(data[key][0]*100) / 100;
|
|
values.push({
|
|
x: value,
|
|
y: data[key][1],
|
|
class: data[key][2],
|
|
size: 0.05,
|
|
shape: 'diamond'
|
|
});
|
|
});
|
|
|
|
return [
|
|
{
|
|
key: label,
|
|
values: values,
|
|
color: "#4572A7"
|
|
}
|
|
];
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|