Skip to content

Commit

Permalink
IGNITE-11277 Added maven-checkstyle-plugin config and code style fixes (
Browse files Browse the repository at this point in the history
  • Loading branch information
Mmuzaf authored and daradurvs committed Apr 22, 2019
1 parent 7f47d0f commit 2b94074
Show file tree
Hide file tree
Showing 141 changed files with 343 additions and 2,039 deletions.
24 changes: 24 additions & 0 deletions checkstyle/checkstyle-suppressions.xml
@@ -0,0 +1,24 @@
<?xml version="1.0"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
</suppressions>
42 changes: 42 additions & 0 deletions checkstyle/checkstyle.xml
@@ -0,0 +1,42 @@
<?xml version="1.0"?>

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>

<property name="fileExtensions" value="java, properties, xml"/>

<!-- Whitespaces Checks. See: http://checkstyle.sourceforge.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>

<module name="TreeWalker">
<!-- Import Checks. See: http://checkstyle.sourceforge.net/config_imports.html -->
<module name="UnusedImports"/>

<!--Modifiers Checks. See: http://checkstyle.sourceforge.net/config_modifier.html-->
<module name="ModifierOrder"/>

<!--Annotation checks. See: http://checkstyle.sourceforge.net/config_annotation.html-->
<module name="MissingOverride"/>
</module>
</module>
Expand Up @@ -38,13 +38,8 @@ public OptimizeMakeChangeFitnessFunction(int targetAmount) {
this.targetAmount = targetAmount;
}

/**
* Calculate fitness.
*
* @param genes List of genes.
* @return Fitness value.
*/
public double evaluate(List<Gene> genes) {
/** {@inheritDoc} */
@Override public double evaluate(List<Gene> genes) {
int changeAmount = getAmountOfChange(genes);
int totalCoins = getTotalNumberOfCoins(genes);
int changeDifference = Math.abs(targetAmount - changeAmount);
Expand Down
Expand Up @@ -46,15 +46,8 @@ public class OptimizeMakeChangeTerminateCriteria implements ITerminateCriteria {
this.logConsumer = logConsumer;
}

/**
* Check whether termination condition is met.
*
* @param fittestChromosome Most fit chromosome at for the nth generation.
* @param averageFitnessScore Average fitness score as of the nth generation.
* @param currGeneration Current generation.
* @return Status whether condition is met or not.
*/
public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
/** {@inheritDoc} */
@Override public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
int currGeneration) {
boolean isTerminate = true;

Expand Down
Expand Up @@ -33,13 +33,8 @@
* contains 11 characters.</p>
*/
public class HelloWorldFitnessFunction implements IFitnessFunction {
/**
* Calculate fitness.
*
* @param genes List of Genes.
* @return Fitness value.
*/
public double evaluate(List<Gene> genes) {
/** {@inheritDoc} */
@Override public double evaluate(List<Gene> genes) {
double matches = 0;

for (int i = 0; i < genes.size(); i++) {
Expand Down
Expand Up @@ -48,15 +48,8 @@ public class HelloWorldTerminateCriteria implements ITerminateCriteria {
this.logConsumer = logConsumer;
}

/**
* Check whether termination condition is met.
*
* @param fittestChromosome Most fit chromosome at for the nth generation.
* @param averageFitnessScore Average fitness score as of the nth generation.
* @param currGeneration Current generation.
* @return Status whether condition is met or not.
*/
public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
/** {@inheritDoc} */
@Override public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
int currGeneration) {
boolean isTerminate = true;

Expand Down
Expand Up @@ -31,13 +31,8 @@
* To do this, we total the weights and values of all the genes within a chromosome.</p>
*/
public class KnapsackFitnessFunction implements IFitnessFunction {
/**
* Calculate fitness.
*
* @param genes List of Genes.
* @return Fitness value.
*/
public double evaluate(List<Gene> genes) {
/** {@inheritDoc} */
@Override public double evaluate(List<Gene> genes) {
double val = 0;
double weight = 0;

Expand Down
Expand Up @@ -48,15 +48,8 @@ public class KnapsackTerminateCriteria implements ITerminateCriteria {
this.logConsumer = logConsumer;
}

/**
* Check whether termination condition is met.
*
* @param fittestChromosome Most fit chromosome at for the nth generation.
* @param averageFitnessScore Average fitness score as of the nth generation.
* @param currGeneration Current generation.
* @return Status whether condition is met or not.
*/
public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
/** {@inheritDoc} */
@Override public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
int currGeneration) {
boolean isTerminate = true;

Expand Down
Expand Up @@ -46,13 +46,8 @@ public MovieFitnessFunction(List<String> genres) {
this.genres = genres;
}

/**
* Calculate fitness score.
*
* @param genes List of Genes.
* @return Fitness score.
*/
public double evaluate(List<Gene> genes) {
/** {@inheritDoc} */
@Override public double evaluate(List<Gene> genes) {
double score = 0;
List<String> duplicates = new ArrayList<>();
int badSolution = 1;
Expand Down
Expand Up @@ -49,15 +49,8 @@ public class MovieTerminateCriteria implements ITerminateCriteria {

}

/**
* Check whether termination condition is met.
*
* @param fittestChromosome Most fit chromosome at for the nth generation.
* @param averageFitnessScore Average fitness score as of the nth generation.
* @param currGeneration Current generation.
* @return Status whether condition is met or not.
*/
public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
/** {@inheritDoc} */
@Override public boolean isTerminationConditionMet(Chromosome fittestChromosome, double averageFitnessScore,
int currGeneration) {
boolean isTerminate = true;

Expand Down
113 changes: 0 additions & 113 deletions idea/disabled_plugins.txt

This file was deleted.

0 comments on commit 2b94074

Please sign in to comment.