Skip to content

Commit

Permalink
Merge branch 'v1.8' into 'master'
Browse files Browse the repository at this point in the history
Bump version numbers

See merge request se2/litterbox!545
  • Loading branch information
gofraser committed Aug 26, 2022
2 parents 90a91ed + 7ed0e9b commit e7a719c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 18 deletions.
49 changes: 33 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ produce an executable jar-file, run the following command:
mvn package
```

This will produce `target/Litterbox-1.7.jar`
This will produce `target/Litterbox-1.8.jar`


## Using LitterBox

To see an overview of the command line options available in LitterBox type:

```
java -jar Litterbox-1.7.jar --help
java -jar Litterbox-1.8.jar --help
```

### Basic usage
Expand All @@ -46,7 +46,7 @@ LitterBox parses the JSON file of a Scratch project, which contains
its source code. Given such a JSON file, LitterBox is invoked as follows:

```
java -jar Litterbox-1.7.jar --check --path <path/to/project.json>
java -jar Litterbox-1.8.jar --check --path <path/to/project.json>
```

As a result, LitterBox will report any occurrences of bug patterns or
Expand All @@ -59,7 +59,7 @@ If you want to check a specific project given its ID (which you can
find in the URL of the project), you can use the following command:

```
java -jar Litterbox-1.7.jar --check --projectid <projectid> --path <path/to/store/downloaded/project>
java -jar Litterbox-1.8.jar --check --projectid <projectid> --path <path/to/store/downloaded/project>
```

When invoked this way, LitterBox will retrieve the JSON file
Expand All @@ -75,7 +75,7 @@ project IDs to check in a text file (one project ID per line) and
invoke LitterBox as follows:

```
java -jar Litterbox-1.7.jar --check --projectlist <path/to/projectidlist.txt> --path <path/to/projects>
java -jar Litterbox-1.8.jar --check --projectlist <path/to/projectidlist.txt> --path <path/to/projects>
```

LitterBox will check the given path for the projects.
Expand All @@ -91,7 +91,7 @@ filename specified in order to decide whether to produce CSV or JSON
output:

```
java -jar Litterbox-1.7.jar --check --path <path/to/project.json> --output <result.csv>
java -jar Litterbox-1.8.jar --check --path <path/to/project.json> --output <result.csv>
```

The CSV file will contain a high-level summary of the number of
Expand All @@ -103,7 +103,7 @@ analyzed Scratch-project, where all occurrences of bug patterns are
highlighted with comments.

```
java -jar Litterbox-1.7.jar --check --path <path/to/project.json> --annotate <result.json>
java -jar Litterbox-1.8.jar --check --path <path/to/project.json> --annotate <result.json>
```


Expand All @@ -119,36 +119,43 @@ comma-separated list of bug patterns, e.g.:


```
java -jar Litterbox-1.7.jar --check --path <path/to/project.json> --detectors endless_recursion,call_without_definition
java -jar Litterbox-1.8.jar --check --path <path/to/project.json> --detectors endless_recursion,call_without_definition
```

A full list of available bug checkers can be retrieved using:


```
java -jar Litterbox-1.7.jar --help
java -jar Litterbox-1.8.jar --help
```

To select all bug patterns, you can also use the term `bugs` in the
list; to select all code smell checks use `smells`.

### Deactivating robot finders

To deactivate finders for the mBlock and Codey Rocky robots set the flag
in the litterbox.properties file to false. This can reduce the run time of
the analysis and the size of a resulting CSV file.

```
issues.load_mblock=false
```

### Collecting statistics

LitterBox can produce statistics on code metrics of a project (e.g.,
number of blocks, number of sprites, weighted method count):

```
java -jar Litterbox-1.7.jar --stats --path <path/to/project.json> --output <statsfile.csv>
java -jar Litterbox-1.8.jar --stats --path <path/to/project.json> --output <statsfile.csv>
```

### Automatically refactoring projects

Since version 1.7 Litterbox can automatically refactor a given Scratch project to improve its readability:

```
java -jar Litterbox-1.7.jar \
java -jar Litterbox-1.8.jar \
--refactor \
--path <path/to/project.json> \
--refactored-projects <path/to/output-dir>
Expand All @@ -166,7 +173,7 @@ Litterbox produces a file with exactly these rules. It's like a Scratch extracto
multiple projects and produces the output to the declared output folder.

```
java -jar target/Litterbox-1.7-SNAPSHOT.jar -c2v -output <path/to/folder/for/the/output> -path <path/to/json/project/or/folder/with/projects>
java -jar target/Litterbox-1.8-SNAPSHOT.jar -c2v -output <path/to/folder/for/the/output> -path <path/to/json/project/or/folder/with/projects>
```

There are some differences between Scratch and "normal" programming languages like Java, but the most important is,
Expand Down Expand Up @@ -201,12 +208,21 @@ in Proceedings of the IEEE/ACM 43rd International Conference on Software Enginee
To learn more about bug patterns, see the following paper:

C. Frädrich, F. Obermüller, N. Körber, U. Heuer, and G. Fraser, “Common bugs in scratch programs,” in Proceedings of
the 25th Annual Conference on Innovation and Technology in Computer
Science Education (ITiCSE), pages 89-95, ACM, 2020. [https://doi.org/10.1145/3341525.3387389](https://doi.org/10.1145/3341525.3387389)
the 25th Annual Conference on Innovation and Technology in Computer
Science Education (ITiCSE), pages 89-95, ACM,
2020. [https://doi.org/10.1145/3341525.3387389](https://doi.org/10.1145/3341525.3387389)

To learn more about code perfumes, see the following paper:

F. Obermüller, L. Bloch, L. Greifenstein, U. Heuer, and G. Fraser, "Code Perfumes: Reporting Good Code to Encourage Learners", in Proceedings of the 16th Workshop in Primary and Secondary Computing Education (WiPSCE ’21). ACM, 2021. [https://arxiv.org/abs/2108.06289](https://arxiv.org/abs/2108.06289)
F. Obermüller, L. Bloch, L. Greifenstein, U. Heuer, and G. Fraser, "Code Perfumes: Reporting Good Code to Encourage
Learners", in Proceedings of the 16th Workshop in Primary and Secondary Computing Education (WiPSCE ’21). ACM,
2021. [https://arxiv.org/abs/2108.06289](https://arxiv.org/abs/2108.06289)

To learn more about code patterns in mBlock robot programs, see the following paper:

F. Obermüller, R. Pernerstorfer, L. Bailey, U. Heuer, and G. Fraser, "Common Patterns in Block-Based Robot Programs",
in Proceedings of the 17th Workshop in Primary and Secondary Computing Education (WiPSCE ’22). ACM,
2022. [https://doi.org/10.1145/3556787.3556859](https://doi.org/10.1145/3556787.3556859)

## Contributors

Expand All @@ -232,6 +248,7 @@ Jonas Lerchenberger\
Stephan Lukasczyk\
Miriam Münch\
Florian Obermüller\
Robert Pernerstorfer\
Gregorio Robles\
Lisa-Marina Salvesen\
Sebastian Schweikl\
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.uni_passau.fim.se2</groupId>
<artifactId>Litterbox</artifactId>
<version>1.8-SNAPSHOT</version>
<version>1.8</version>

<build>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/IssueHints_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ gear_potentiometer_in_bounds=Very nice! You are measuring the potentiometer valu
gear_potentiometer_out_of_bounds=You are trying to measure the potentiometer value of the gear of the robot in a range that is not possible. Use a whole number between 0 and 100.
interrupted_loop_sensing_robot=The [bc]%BLOCKNAME[/bc] block interrupts the checking of the condition in the [bc]%THENELSE[/bc] block while being executed. It can happen that the condition occurs but your script doesn't react accordingly because it is busy doing the [bc]%BLOCKNAME[/bc] block. Consider doing the condition checking in a separate (parallel) script.
led_off_script=Great! You have a script for turning off all LEDs.
led_off_script_missing=LEDs can be switched on, but there is no script to switch them off again.
led_off_script_missing=The LEDs on your robot are still turned on after the program has stopped. Add an LED Off block at the end of your program.
line_following_in_bounds=Very nice! You are comparing the value of the line following sensor in the possible range.
line_following_out_of_bounds=You are trying to measure a value that can not be detected with the line following sensor. Use a whole number between 0 und 3.
loop_sensing_robot=Very good! To ensure that you don\uFFFDt miss an event you continuously check for it in a forever loop.
Expand Down

0 comments on commit e7a719c

Please sign in to comment.