Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • z20026252/M1-INFO-FSI-TP-template
  • alaboure/M1-INFO-FSI-TP-template
  • d23022755/M1-INFO-FSI-TP-template
  • m19025211/m-1-info-fsi-tp-template-mededji
  • b24026857/tp-1-fl
  • a24025370/M1-INFO-FSI-TP-template
6 results
Select Git revision
Loading items
Show changes
Commits on Source (6)
Showing
with 112 additions and 8 deletions
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
# M1 INFO FSI TP 4
Lancer PMD avec la commande suivante :
- Lancer PMD sur le code `main` avec la commande suivante :
```
./gradlew pmdMain
```
- Lancer PMD sur le code `test` avec la commande suivante :
```
./gradlew pmdTest
```
- Lancer SpotBugs sur le code `main` avec la commande suivante :
```
./gradlew spotbugsMain
```
- Lancer SpotBugs sur le code `test` avec la commande suivante :
```
./gradlew spotbugsTest
```
- Lancer sonarlint sur le code `main` avec la commande suivante :
```
./gradlew sonarlintMain
```
- Lancer sonarlint sur le code `test` avec la commande suivante :
```
./gradlew sonarlintTest
```
\ No newline at end of file
......@@ -2,6 +2,8 @@ plugins {
id("java")
id("application")
id("pmd")
id("com.github.spotbugs") version "6.1.3"
id ("name.remal.sonarlint") version "5.1.1"
}
repositories {
......@@ -19,8 +21,6 @@ tasks.test {
useJUnitPlatform()
}
pmd {
isConsoleOutput = true
toolVersion = "7.0.0-rc1"
......@@ -28,7 +28,9 @@ pmd {
ruleSets = listOf("rulesets/java/quickstart.xml", "category/java/errorprone.xml", "category/java/bestpractices.xml")
}
spotbugs {
toolVersion = "4.9.0"
}
application {
mainClass.set("Main")
......
#include <limits.h>
#include "__fc_builtin.h"
/*@
ensures \result >= 0;
*/
int abs(int val)
{
if (val < 0)
return -val;
return val;
}
/*@ ensures \result == a + b;
*/
int add(int a, int b)
{
return a + b;
}
/*@ ensures \result == a/b;
*/
int div(int a, int b)
{
return a / b;
}
int main(void)
{
int a = abs(42);
int b = abs(-42);
int c = abs(-74);
int d = add(a, c);
int e = add(d, d);
// b = add(INT_MAX,42); //cas d’erreur 1
// a = abs(INT_MIN); //cas d’erreur 2
a = div(4, 8);
b = div(17, -12);
// c = div(15,0); //cas d’erreur 3
a = div(-12, 54);
}
\ No newline at end of file
#include "max.h"
int max(int a, int b)
{
int res = a;
if (res < b)
res = b;
return res;
}
\ No newline at end of file
/*Put your specification here.
*/
int max(int a, int b);
\ No newline at end of file
#include "max_5.h"
int max(int a, int b, int c, int d, int e)
{
int res = a;
if (res < b)
res = b;
if (res < c)
res = c;
if (res < d)
res = d;
if (res < e)
res = e;
return res;
}
\ No newline at end of file
/*Put your specification here.
*/
int max(int a, int b, int c, int d, int e);
\ No newline at end of file