Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Grsp0008 php #110

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Grsp0008 php #110

wants to merge 6 commits into from

Conversation

mouradmamassi
Copy link
Collaborator

To review GRSP0008 - [PHP] - Utiliser un chemin absolu pour un import de fichier (include)

}

public void checkIssue(FunctionCallTree functionCallTree) {
if(functionCallTree.callee().toString().equals("include") || functionCallTree.callee().toString().equals("require")){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Il manque également les méthodes d'import include_once et require_once

public void checkIssue(FunctionCallTree functionCallTree) {
if(functionCallTree.callee().toString().equals("include") || functionCallTree.callee().toString().equals("require")){
ParenthesisedExpressionTree expressionTree = (ParenthesisedExpressionTree) functionCallTree.arguments().get(0);
if(!expressionTree.expression().toString().startsWith("\"/")){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cela ne fonctionnera malheureusement pas dans la plupart des cas. L'exemple de bonne solution de greenspector par exemple :

include __DIR__ . 'foo.php';

Va générer une erreur avec votre check

@KuSh KuSh mentioned this pull request Jun 3, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dedece35 dedece35 added the rule this is a problem on a rule label Nov 8, 2022
@dedece35
Copy link
Collaborator

Bonjour @mouradmamassi ,

merci de prendre en comptes les retours de @KuSh ainsi que de corriger les pbs cités ci-dessus, SVP.

merci à vous.
David

(for information, we are migrating this repo to a new one : https://github.com/green-code-initiative/ecocode-mobile, I will report your modifications manually)

@dedece35 dedece35 marked this pull request as draft December 5, 2022 13:42
@dedece35
Copy link
Collaborator

dedece35 commented Dec 5, 2022

Hi @mouradmamassi ,
we are migrating this repo to a new one : please see green-code-initiative/ecoCode#6
that's why I change this PR to "draft".

@dedece35 dedece35 added the migrated_to_new_standrad_repo if is migrated to new standard repo label Dec 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
check:php migrated_to_new_standrad_repo if is migrated to new standard repo rule this is a problem on a rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants