Skip to content

Commit

Permalink
finalisation rapport 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitLeveque committed Mar 14, 2023
1 parent b08243f commit 3a4711e
Show file tree
Hide file tree
Showing 9 changed files with 205 additions and 4 deletions.
4 changes: 4 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ services:

App\Report\SpecialityReport:
parent: App\Report\AbstractReport
calls:
- setChildReports: [ [ '@App\Report\SpecialityEvolutionReport' ] ]
tags: ['barometre.report']

App\Report\ExperienceSalaryReport:
Expand All @@ -196,6 +198,8 @@ services:

App\Report\SalarySatisfactionReport:
parent: App\Report\AbstractReport
calls:
- setChildReports: [ [ '@App\Report\SalarySatisfactionEvolutionReport' ] ]
tags: [ 'barometre.report' ]

App\Report\PhpVersionEvolutionReport:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/reports/2022/evolution_specialites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions src/Report/SalarySatisfactionEvolutionReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace App\Report;

class SalarySatisfactionEvolutionReport extends AbstractDistributionEvolutionReport
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'salary_satisfaction_evolution';
}

/**
* {@inheritdoc}
*/
protected function getFieldName()
{
return 'salarySatisfaction';
}
}
103 changes: 103 additions & 0 deletions src/Report/SpecialityEvolutionReport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?php

declare(strict_types=1);

namespace App\Report;

use App\RequestModifier\RequestModifierCollection;
use Symfony\Component\HttpFoundation\Request;

class SpecialityEvolutionReport extends AbstractReport implements AlterableReportInterface
{
/**
* @param int $minResult
*/
public function __construct(private readonly RequestModifierCollection $requestModifierCollection, $minResult = 10)
{
parent::__construct($minResult);
}

/**
* {@inheritdoc}
*/
public function execute()
{
$this->queryBuilder
->select('speciality.name as specialityName')
->addSelect('campaign.name')
->addSelect('COUNT(response.id) as nbResponse')
->add('where', 'speciality.name is not null')
->join(
'response',
'response_speciality',
'response_speciality',
'response.id = response_speciality.response_id'
)
->join(
'response_speciality',
'speciality',
'speciality',
'response_speciality.speciality_id = speciality.id'
)
->join('response', 'campaign', 'campaign', 'response.campaign_id = campaign.id')
->having('nbResponse >= :minResult')
->setParameter('minResult', $this->minResult)
->groupBy('response.campaign_id')
->addGroupBy('specialityName')
->addOrderBy('campaign.name')
->addOrderBy('specialityName', 'asc')
;

// top 5 technos
$framework = [
'Symfony',
'Laravel',
'Zend Framework',
'Wordpress',
'Drupal',
];

$otherFramework = 'Autre';

$columns = array_merge($framework, [$otherFramework]);
sort($columns);

$data = [];

foreach ($this->queryBuilder->fetchAllAssociative() as $row) {
$specialityName = $otherFramework;

if (\in_array($row['specialityName'], $framework, true)) {
$specialityName = $row['specialityName'];
}

if (!isset($data[$row['name']][$specialityName])) {
$data[$row['name']][$specialityName] = 0;
}

$data[$row['name']][$specialityName] += $row['nbResponse'];
}

foreach ($data as $campaignId => $values) {
$data[$campaignId] = $values + array_fill_keys($columns, 0);
ksort($data[$campaignId]);
}

if (\count($data)) {
$this->data = [
'data' => $data,
'columns' => $columns,
];
}
}

public function alterRequest(Request $request)
{
$this->requestModifierCollection->getModifier('filter_on_all_campaigns')->alterRequest($request);
}

public function getName()
{
return 'speciality_evolution';
}
}
11 changes: 7 additions & 4 deletions templates/Campaign/report2022.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@

<h2>Un hausse de la satisfaction de la rémunération</h2>

<p>TODO</p>

<a href="{{ absolute_url('/report/salary_satisfaction?filter[campaign][0]='~campaignId) }}" class="report-image">
<img src="{{ asset('reports/2022/evolution_satisfaction_salaire.png') }}" alt="Évolution du salaire"/>
</a>

<p>L'enquête, comme les 2 précédentes, a été menée dans une période de crise et d'instabilité économique. Comment cela a t il impacté la satisfaction de la rémunération sur les postes de développeur et développeuses en CDI ?</p>

Expand All @@ -99,12 +100,10 @@

<h2>La tendance du télétravail qui se confirme</h2>


<a href="{{ absolute_url('/report/remote_usage?filter[campaign][]='~campaignId) }}" class="report-image">
<img src="{{ asset('reports/2022/evolution_remote.png') }}" alt="Évolution du télétravail"/>
</a>


<p>En 2019, 6,3% de répondants et répondantes indiquent faire exclusivement du télétravail.</p>

<p>Depuis 2020, la tendance au télétravail à temps complet n'a eu de cesse de se confirmer, pour passer de 19% en 2020 à 28% en 2021 pour atteindre 34% en 2022.</p>
Expand All @@ -115,6 +114,10 @@

<h2>La fin des frameworks propriétaires</h2>

<a href="{{ absolute_url('/report/speciality?filter[campaign][]='~campaignId) }}" class="report-image">
<img src="{{ asset('reports/2022/evolution_specialites.png') }}" alt="Évolution des spécialités"/>
</a>

<p>Cette année sur le site du baromètre vous pouvez retrouver l’évolution de l’usage des différents frameworks à travers le temps.</p>

<p>D’après celui-ci nous pouvons constater que nous sommes définitivement entrés dans l'ère du framework : en 2017, nous avons encore 11% d’usage de frameworks propriétaires. Ce chiffre baisse pour atteindre 5% en 2022. </p>
Expand Down
15 changes: 15 additions & 0 deletions templates/Report/salary_satisfaction_evolution.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% set color = {
(constant('App\\Enums\\SalarySatisfactionEnums::TRES_INSATISFAIT')):'#550000',
(constant('App\\Enums\\SalarySatisfactionEnums::INSATISFAIT')):'#b73030',
(constant('App\\Enums\\SalarySatisfactionEnums::SANS_OPINION')):'#999999',
(constant('App\\Enums\\SalarySatisfactionEnums::STATISFAIT')):'#259433',
(constant('App\\Enums\\SalarySatisfactionEnums::TRES_SATISFAIT')):'#008110'
}
%}

{% set fieldName = 'App\\Enums\\SalarySatisfactionEnums' %}
{% set title = 'Année' %}

{% block report_content %}
{% include 'Report/_distribution_evolution_report.html.twig' with {'color': color, 'fieldName': fieldName} %}
{% endblock %}
44 changes: 44 additions & 0 deletions templates/Report/speciality_evolution.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{% set color = {
'Symfony': '#000000',
'Laravel': '#b73030',
'Zend Framework' : '#008110',
'Wordpress': '#0472A7',
'Drupal': '#006DB7',
'report.view.other_framework': '#999999'
}
%}

{% set title = 'Année' %}

{% block report_content %}
<table class="highchart abstract-distribution-evolution"
data-graph-container-before="1"
data-graph-type="column"
style="display:none"
data-graph-datalabels-enabled="1"
data-graph-datalabels-color="white"
data-graph-stacking="percent"
>
<thead>
<tr>
<th>{{ title }}</th>
{% for data in results.columns %}
<th data-graph-stack-group="1"
data-graph-color="{{ color[data] is defined ? color[data] : '#999' }}"
>{{ data }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for year,yearResults in results.data %}
<tr>
<td>{{ year }}</td>
{% for row in yearResults %}
<td class="text-right">{{ row }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>

{% endblock %}
8 changes: 8 additions & 0 deletions translations/messages.fr.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@
<source>report.meetup_participation_evolution.label</source>
<target>Évolution de la participation aux meetups</target>
</trans-unit>
<trans-unit id="report.salary_satisfaction_evolution.label">
<source>report.salary_satisfaction_evolution.label</source>
<target>Évolution de la satisfaction de la rémunération</target>
</trans-unit>
<trans-unit id="report.speciality_evolution.label">
<source>report.speciality_evolution.label</source>
<target>Évolution des spécialités</target>
</trans-unit>
<trans-unit id="report.speciality.label">
<source>report.speciality.label</source>
<target>Distribution des spécialités</target>
Expand Down

0 comments on commit 3a4711e

Please sign in to comment.