Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

944 analyze authorship #2147

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b4fc81b
add isAuthorshipAnalyzed flag
SkyBlaise99 Jul 26, 2023
1ea3210
add isAuthorshipAnalyzed to cli arguments
SkyBlaise99 Jul 26, 2023
5e2cdea
reformat cli args
SkyBlaise99 Jul 26, 2023
df5e498
added test cases for args parser
SkyBlaise99 Jul 27, 2023
9b77bda
reformat ArgsParserTest and InputBuilder
SkyBlaise99 Jul 27, 2023
689cdb3
update equals method in cli args
SkyBlaise99 Jul 27, 2023
cb0cf90
pass shouldAnalyzeAuthorship flag from reposense to report generator …
SkyBlaise99 Jul 30, 2023
81b7621
update javadocs for report generator and authorship reporter
SkyBlaise99 Jul 30, 2023
bce2fb2
reformat report generator and authorship reporter
SkyBlaise99 Jul 30, 2023
eb488bc
pass shouldAnalyzeAuthorship flag from authorship reporter to file in…
SkyBlaise99 Aug 1, 2023
e724d47
update javadocs for file info analyzer
SkyBlaise99 Aug 1, 2023
33e393d
add overloading method to fix failing testcases
SkyBlaise99 Aug 1, 2023
72921d7
implement authorship analyzer
SkyBlaise99 Aug 6, 2023
f3fbc33
reformat files
SkyBlaise99 Aug 6, 2023
f7cbe5b
set to default full credit
SkyBlaise99 Aug 7, 2023
03c1a2a
update expected outputs for local repo system tests
SkyBlaise99 Aug 7, 2023
acc6665
update expected outputs for config system tests
SkyBlaise99 Aug 7, 2023
71839dd
update comment
SkyBlaise99 Aug 7, 2023
c8442b8
add test cases for new git methods
SkyBlaise99 Aug 13, 2023
7b69c31
add AuthorshipAnalyzer test cases
SkyBlaise99 Aug 13, 2023
983c784
convert since date to millisec using config's zone id
SkyBlaise99 Aug 13, 2023
dc57517
fix error in obtaining commit time
SkyBlaise99 Aug 13, 2023
cadbeb2
shift getLevenshteinDistance to StringsUtil
SkyBlaise99 Aug 16, 2023
45539c1
fix warnings
SkyBlaise99 Aug 16, 2023
b2d6a08
Merge branch 'master' into 944-analyze-authorship
SkyBlaise99 Aug 17, 2023
397ca6f
store isFullCredit info into segments
SkyBlaise99 Aug 18, 2023
40a7598
store as a single value when the whole segment are all full credit,
SkyBlaise99 Aug 18, 2023
9272869
rename variable
SkyBlaise99 Aug 18, 2023
00c4036
update background for is not full credit
SkyBlaise99 Aug 18, 2023
97f1966
Merge branch 'master' into 944-analyze-authorship
SkyBlaise99 Aug 24, 2023
971cc80
switch to jdk 8 methods
SkyBlaise99 Aug 24, 2023
8293e0f
remove unused imports
SkyBlaise99 Aug 24, 2023
f8a8f30
Merge branch 'master' into 944-analyze-authorship
SkyBlaise99 Sep 1, 2023
489cf6d
fix null pointer exception caused by
SkyBlaise99 Sep 5, 2023
174ecc5
Merge branch 'master' into 944-analyze-authorship
SkyBlaise99 Oct 20, 2023
e200e5e
Give partial credit if annotated author is not the same as the blame
SkyBlaise99 Oct 20, 2023
bdeb15a
use full and partial credit color
SkyBlaise99 Oct 29, 2023
a187d9c
Add test cases for annotated author overriding last author's credit
SkyBlaise99 Nov 7, 2023
58b7002
Merge branch 'master' into 944-analyze-authorship
SkyBlaise99 Nov 7, 2023
b296b83
revert merge from master
SkyBlaise99 Nov 7, 2023
4ce6545
revert merge from master 58b70025
SkyBlaise99 Nov 7, 2023
4bd05a7
Trigger workflow
SkyBlaise99 Nov 8, 2023
950c912
Merge branch 'master' into 944-analyze-authorship
SkyBlaise99 Nov 8, 2023
a46d423
Revert "Merge branch 'master' into 944-analyze-authorship"
SkyBlaise99 Nov 8, 2023
bba556d
fix frontend test failing
SkyBlaise99 Nov 8, 2023
a8b0b19
[#944] Fix failing frontend tests (#2068)
SkyBlaise99 Nov 11, 2023
4d7d3aa
Merge branch '944-analyze-authorship' into 944-analyze-authorship
SkyBlaise99 Nov 12, 2023
b827cc8
[#944] Fix wrong credit information inherited by annotated author (#2…
SkyBlaise99 Nov 12, 2023
1b25572
Merge branch '944-swap-color' into 944-analyze-authorship
SkyBlaise99 Nov 12, 2023
9e93961
Merge branch 'reposense:944-analyze-authorship' into 944-analyze-auth…
SkyBlaise99 Nov 12, 2023
086a64b
[#944] Improve visualization for full and partial credit (#2070)
SkyBlaise99 Jan 8, 2024
c85423e
[#944] Change to originality score and new threshold value (#2072)
SkyBlaise99 Jan 8, 2024
896c55a
Merge branch 'reposense:944-analyze-authorship' into 944-analyze-auth…
SkyBlaise99 Jan 8, 2024
e8cb72a
[#944] Differentiate full and partial credit when group is merged (#2…
SkyBlaise99 Jan 27, 2024
39c8058
Merge branch 'reposense:944-analyze-authorship' into 944-analyze-auth…
SkyBlaise99 Jan 31, 2024
79209a3
[#944] Add originality threshold flag (#2122)
SkyBlaise99 Mar 3, 2024
fdd2dae
[#944] Improve performance (#2108)
SkyBlaise99 Mar 3, 2024
34b3673
Merge branch 'reposense:944-analyze-authorship' into 944-analyze-auth…
SkyBlaise99 Mar 3, 2024
b90b9a3
[#944] Resolve Merge Conflict (#2139)
SkyBlaise99 Mar 7, 2024
a59f992
Merge branch 'reposense:944-analyze-authorship' into 944-analyze-auth…
SkyBlaise99 Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RepoSense is a contribution analysis tool for Git repositories. It is particular
- [User Guide for the latest `master` (not yet released to users)](https://reposense.github.io/RepoSense)

---
### Our Contributors :
<a href="https://github.com/reposense/RepoSense/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reposense/RepoSense" />
</a>

**Acknowledgements**: The web previews of RepoSense is powered by Netlify and Surge.

Expand Down
24 changes: 12 additions & 12 deletions docs/dg/learningBasics.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

Therefore, the first step you can take is to add the following to `ArgsParser`.

```
```java
public static final String[] JSON_PRINT_MODE_FLAGS = new String[]{"--use-json-pretty-printing", "-j"};
```

In `getArgumentParser` method, add the following content to make `ArgumentParser` capture the new argument.

```
```java
parser.addArgument(JSON_PRINT_MODE_FLAGS)
.dest(JSON_PRINT_MODE_FLAGS[0])
.action(Arguments.storeTrue())
Expand All @@ -102,7 +102,7 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

1. Add the following content to `CliArguments` to include `isPrettyPrintingUsed` as a new attribute to the class.

```
```java
protected boolean isPrettyPrintingUsed;

public boolean isPrettyPrintingUsed() {
Expand All @@ -112,13 +112,13 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

2. In the constructor of `ConfigCliArguments`, add `isPrettyPrintingUsed` as a new parameter of the method, and add the following instruction to the method body.

```
```java
this.isPrettyPrintingUsed = isPrettyPrintingUsed;
```

3. In the `parse` method of `ArgsParser`, add the following instruction to get `isJsonPrettyPrintingUsed` from `ArgmentParser`.

```
```java
boolean isJsonPrettyPrintingUsed = results.get(JSON_PRINT_MODE_FLAGS[0]);
```

Expand All @@ -139,13 +139,13 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

2. Add the following content to `FileUtil`.

```
```java
private static boolean isPrettyPrintingUsed = false;
```

3. In the `writeJsonFile` method, Replace the creation of the `Gson` object with the following instructions.

```
```java
GsonBuilder gsonBuilder = new GsonBuilder()
.registerTypeAdapter(LocalDateTime.class, (JsonSerializer<LocalDateTime>) (date, typeOfSrc, context)
-> new JsonPrimitive(date.format(DateTimeFormatter.ofPattern(GITHUB_API_DATE_FORMAT))))
Expand All @@ -160,15 +160,15 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

4. To notify `FileUtil` of the switch between different printing mode, add the following method to `FileUtil`.

```
```java
public static void setPrettyPrintingMode(boolean isPrettyPrintingAdopted) {
isPrettyPrintingUsed = isPrettyPrintingAdopted;
}
```

5. It is now possible to notify `FileUtil` of the printing mode switch by extracting the argument from the `CliArguments` object in the `main` method of `RepoSense.java` and passing it to the corresponding method in `FileUtil`.

```
```java
FileUtil.setPrettyPrintingMode(cliArguments.isPrettyPrintingUsed());
```

Expand Down Expand Up @@ -225,7 +225,7 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

Add this to the catch block of `spawnCloneProcess` and `waitForCloneProcess`, so that the message will be captured in `summary.json`.

```
```java
ErrorSummary.getInstance().addErrorMessage(config.getDisplayName(), e.getMessage());
```
</panel>
Expand Down Expand Up @@ -358,7 +358,7 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

Add this to `c_summary.scss`.

```
```css
.active-text {
color: mui-color('green');
}
Expand Down Expand Up @@ -485,4 +485,4 @@ You can now proceed to learn the [contributing workflow](workflow.html).

## DevOps

If you want to understand and contribute to the DevOps aspect of RepoSense, you can refer to the [DevOps guide](https://github.com/reposense/RepoSense/wiki/DevOps-guide) for more information.
If you want to understand and contribute to the DevOps aspect of RepoSense, you can refer to the [DevOps guide](devOpsGuide.html) for more information.
2 changes: 1 addition & 1 deletion docs/dg/settingUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<box type="info" seamless>

Type `java -version`, `npm -v` and `git --version` respectively on your OS terminal and ensure that you have the correct version of each prerequisite installed.
Type `java -version`, `node -v` and `git --version` respectively on your OS terminal and ensure that you have the correct version of each prerequisite installed.
</box>

<!-- ==================================================================================================== -->
Expand Down
24 changes: 12 additions & 12 deletions docs/dg/styleGuides.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Our coding standards are mostly based on those at [se-education.org/guides](http

## Note on Ternary Operators:
Ternary operators can be used to shorten if-else blocks such as this:
```
```java
LocalDateTime min = ARBITRARY_FIRST_COMMIT_DATE_UTC.withZoneSameInstant(zoneId).toLocalDateTime();
if (!commitInfos.isEmpty()) {
min = commitInfos.get(0).getTime();
Expand All @@ -31,7 +31,7 @@ return min;
```

The result would look something like this:
```
```java
return (commitInfos.isEmpty())
? ARBITRARY_FIRST_COMMIT_DATE_UTC.withZoneSameInstant(zoneId).toLocalDateTime()
: commitInfos.get(0).getTime();
Expand All @@ -48,16 +48,16 @@ In addition to what has been mentioned in the [**Java** coding standard (SE-EDU)
* This is not necessary (although still recommended) for methods with `@Override` annotations if Javadoc is used. However, if the method that is being overriden is part of your code and has Javadoc, all parameters must be described.

Negative Examples:
```
Not okay (Only mentions zoneId parameter):
```java
// Not okay (Only mentions zoneId parameter):
/**
* Returns a {@link LocalDateTime} object adjusted for timezone given by {@code zoneId}.
*/
public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
//Code here
}

Not okay (@param tag used only for zoneId)
// Not okay (@param tag used only for zoneId)
/**
* Returns a {@link LocalDateTime} object by adjusting {@code sinceDate}
* to the timezone given by {@code zoneId}.
Expand All @@ -69,8 +69,8 @@ public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
}
```
Positive Example #1:
```
Okay (No @param tags):
```java
// Okay (No @param tags):
/**
* Returns a {@link LocalDateTime} object by adjusting {@code sinceDate}
* to the timezone given by {@code zoneId}.
Expand All @@ -80,8 +80,8 @@ public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
}
```
Positive Example #2:
```
Okay (@param tags used for all inputs):
```java
// Okay (@param tags used for all inputs):
/**
* Returns a {@link LocalDateTime} object by adjusting {@code sinceDate}
* to the timezone given by {@code zoneId}.
Expand All @@ -98,8 +98,8 @@ public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
* This requirement does not apply to test code.
* One `@throws` tag per unique exception.
* The order of exceptions in the `@throws` tag block should match that of the method's `throws` statement.
```
Not okay (order of exceptions in tag block and method signature do not match):
```java
// Not okay (order of exceptions in tag block and method signature do not match):
/**
* Returns a {@link LocalDateTime} object from {@code dateString}.
*
Expand All @@ -111,7 +111,7 @@ public LocalDateTime parseDate(String dateString) throws NullPointerException, P
// Code here
}

Should be:
// Should be:
/**
* Returns a {@link LocalDateTime} object from {@code dateString}.
*
Expand Down
3 changes: 2 additions & 1 deletion docs/ug/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ The section below provides explanations for each of the flags.
<div id="section-assets">

**`--assets ASSETS_DIRECTORY`**: Specifies where to place assets for report generation.
* Parameter: `ASSETS_DIRECTORY` The directory containing the assets files. A `favicon.ico` file can be placed here to customize the favicon of the dashboard.
* Parameter: `ASSETS_DIRECTORY` The directory containing the assets files. A `favicon.ico` file can be placed here to customize the favicon of the dashboard,
while a `title.md` file can be placed to customize the header of the report using [Markdown syntax](https://www.markdownguide.org/basic-syntax/).
* Alias: `-a`
* Example: `--assets ./assets` or `-a ./assets`

Expand Down
6 changes: 3 additions & 3 deletions docs/ug/configFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ Date: Fri Feb 9 19:13:13 2018 +0800
```
`ActualGitHostId` and `ConfiguredAuthorName` are both `Git Author Name` of the same author.<br>
To find the author name that you are currently using for your current git repository, run the following command within your git repository:
``` {.no-line-numbers}
``` shell {.no-line-numbers}
git config user.name
```
To set the author name to the value you want (e.g., to set it to your GitHub username) for your current git repository, you can use the following command ([more info](https://www.git-tower.com/learn/git/faq/change-author-name-email)):
``` {.no-line-numbers}
``` shell {.no-line-numbers}
git config user.name "YOUR_AUTHOR_NAME”
```
To set the author name to use a default value you want for future git repositories, you can use the following command:
``` {.no-line-numbers}
``` shell {.no-line-numbers}
git config --global user.name "YOUR_AUTHOR_NAME”
```
RepoSense expects the Git Author Name to be the same as author's username on the Git hosting platform (GitHub, GitLab, BitBucket). If an author's `Git Author Name` is different from their username on the Git hosting platform, the `Git Author Name` needs to be specified in the standalone config file. If the author has more than one `Git Author Name`, multiple values can be entered too.
Expand Down
21 changes: 20 additions & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,26 @@
}
],
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/type-annotation-spacing": "error"
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array-simple",
"readonly": "array-simple"
}
]
}
},
{
"files": ["*.vue"],
"rules": {
"@typescript-eslint/array-type": [
"error",
{
"default": "generic",
"readonly": "generic"
}
]
}
}
]
Expand Down
4 changes: 3 additions & 1 deletion frontend/.stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"scss/no-global-function-names": null,
"selector-type-no-unknown": null,
"at-rule-no-unknown": null,
"no-duplicate-selectors": null
"no-duplicate-selectors": null,
"block-opening-brace-space-before": "always",
"declaration-colon-space-before": "never"
}
}
4 changes: 4 additions & 0 deletions frontend/cypress/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ Cypress.Screenshot.defaults({

beforeEach(() => {
cy.visit('/');
cy.intercept({
method: 'GET',
url: '/title.md',
}, '# RepoSense Intro').as('getTitleMd');
});
11 changes: 11 additions & 0 deletions frontend/cypress/tests/chartView/chartView_zoomFeature.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
Expand All @@ -277,6 +280,9 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
Expand All @@ -303,6 +309,9 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
Expand All @@ -329,6 +338,8 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
Expand Down
Loading
Loading