Skip to content

Commit

Permalink
merged with gulp
Browse files Browse the repository at this point in the history
  • Loading branch information
plutasnyy committed Aug 9, 2018
1 parent cfa80f6 commit 343f24d
Show file tree
Hide file tree
Showing 33 changed files with 14,387 additions and 451 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ atlassian-ide-plugin.xml
/report/src/main/webapp/.sass-cache/
# auto-generated assets
/report/src/main/webapp/assets/libs
# auto-generated css file
/report/src/main/webapp/assets/css

### AET sanity tests
/integration-tests/test-suite/suite.xml
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ All notable changes to AET will be documented in this file.
- [PR-286](https://github.com/Cognifide/aet/pull/286) Shared Patterns - use latest patterns of given suite name ([#121](https://github.com/Cognifide/aet/issues/121))
- [PR-291](https://github.com/Cognifide/aet/pull/291) Updated nu.validator version from 15.6.29 to 17.11.1
- [PR-298](https://github.com/Cognifide/aet/pull/298) Filtering accessibility errors by markup CSS ([#214](https://github.com/Cognifide/aet/issues/214))
- [PR-296](https://github.com/Cognifide/aet/pull/296) Status Code Comparator now checks range 400-600 by default, parameters validation added

## Version 2.1.6

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class StatusCodesComparator implements ComparatorJob {

private static final Logger LOGGER = LoggerFactory.getLogger(StatusCodesComparator.class);

private static final int DEFAULT_FILTER_RANGE_LOWER_BOUND = 400;

private static final int DEFAULT_FILTER_RANGE_UPPER_BOUND = 600;

public static final String COMPARATOR_TYPE = "status-codes";
Expand All @@ -53,14 +55,15 @@ public class StatusCodesComparator implements ComparatorJob {
private static final String PARAM_DELIMITER = ",";

private static final String PARAM_SHOW_EXCLUDED = "showExcluded";

private static final Type RESULT_TYPE = new TypeToken<StatusCodesCollectorResult>() {
}.getType();

private final ArtifactsDAO artifactsDAO;

private final ComparatorProperties properties;

private int filterRangeLowerBound;
private int filterRangeLowerBound = DEFAULT_FILTER_RANGE_LOWER_BOUND;

private int filterRangeUpperBound = DEFAULT_FILTER_RANGE_UPPER_BOUND;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,22 @@ private class StatusCodeFilterPredicate implements Predicate<StatusCode> {

@Override
public boolean apply(StatusCode statusCode) {
if (statusCode.getCode() < lowerBound) {
return false;
}
if (statusCode.getCode() > upperBound) {
return false;
}
if (!filterCodes.isEmpty() && !filterCodes.contains(statusCode.getCode())) {
return false;
}

if (statusCode.getCode() < 0) {
return false;
}
return true;
if (isCodeInRange(statusCode) || isCodeInFilterCodes(statusCode)) {
return true;
}
return false;
}

private boolean isCodeInFilterCodes(StatusCode statusCode) {
return !filterCodes.isEmpty() && filterCodes.contains(statusCode.getCode());
}

private boolean isCodeInRange(StatusCode statusCode) {
return statusCode.getCode() >= lowerBound && statusCode.getCode() <= upperBound;
}
}
}
Loading

0 comments on commit 343f24d

Please sign in to comment.