Skip to content

Commit

Permalink
optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
tommywo committed Jan 27, 2020
1 parent 777ce32 commit 18bf7e4
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.stepstone.sonar.plugin.coldfusion.profile.ColdFusionProfileExporter;
import com.stepstone.sonar.plugin.coldfusion.profile.ColdFusionSonarWayProfileImporter;
import com.stepstone.sonar.plugin.coldfusion.rules.ColdFusionSonarRulesDefinition;

import org.sonar.api.Plugin;
import org.sonar.api.Properties;
import org.sonar.api.Property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,36 @@

package com.stepstone.sonar.plugin.coldfusion;

import com.google.common.base.Preconditions;
import com.stepstone.sonar.plugin.coldfusion.cflint.CFLintAnalyzer;
import com.stepstone.sonar.plugin.coldfusion.cflint.CFLintAnalysisResultImporter;
import com.stepstone.sonar.plugin.coldfusion.cflint.CFLintAnalyzer;
import com.stepstone.sonar.plugin.coldfusion.cflint.CFLintConfigExporter;

import com.google.common.base.Preconditions;

import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.SensorDescriptor;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;

import javax.xml.stream.XMLStreamException;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
import java.util.Collection;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.stream.XMLStreamException;

public class ColdFusionSensor implements Sensor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin;
import com.stepstone.sonar.plugin.coldfusion.cflint.xml.IssueAttributes;
import com.stepstone.sonar.plugin.coldfusion.cflint.xml.LocationAttributes;

import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.sensor.SensorContext;
Expand All @@ -28,13 +29,13 @@
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class CFLintAnalysisResultImporter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

package com.stepstone.sonar.plugin.coldfusion.cflint;

import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin;

import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.config.Configuration;
Expand All @@ -28,9 +30,9 @@
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;

import javax.xml.stream.XMLStreamException;
import java.io.File;
import java.io.IOException;
import javax.xml.stream.XMLStreamException;

public class CFLintAnalyzer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@
package com.stepstone.sonar.plugin.coldfusion.cflint;

import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin;

import org.sonar.api.batch.rule.ActiveRule;

import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Collection;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

public class CFLintConfigExporter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.stepstone.sonar.plugin.coldfusion.cflint;

import static com.google.common.base.Preconditions.checkNotNull;

import org.sonar.api.batch.InstantiationStrategy;

import java.io.File;
Expand All @@ -24,8 +26,6 @@
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;

import static com.google.common.base.Preconditions.checkNotNull;

@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public class CFLintExtractor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@

package com.stepstone.sonar.plugin.coldfusion.profile;

import com.google.common.base.Throwables;
import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin;
import com.stepstone.sonar.plugin.coldfusion.cflint.CFLintConfigExporter;
import org.sonar.api.profiles.ProfileExporter;

import com.google.common.base.Throwables;

import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.profiles.ProfileExporter;
import org.sonar.api.profiles.RulesProfile;

import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.io.Writer;
import javax.xml.stream.XMLStreamException;

public class ColdFusionProfileExporter extends ProfileExporter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.stepstone.sonar.plugin.coldfusion.profile;

import com.google.common.base.Charsets;

import org.sonar.api.profiles.ProfileDefinition;
import org.sonar.api.profiles.RulesProfile;
import org.sonar.api.profiles.XMLProfileParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

package com.stepstone.sonar.plugin.coldfusion.rules;

import static java.nio.charset.StandardCharsets.UTF_8;

import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin;

import org.sonar.api.batch.ScannerSide;
import org.sonar.api.server.rule.RulesDefinition;
import org.sonar.api.server.rule.RulesDefinitionXmlLoader;
import org.sonar.squidbridge.rules.SqaleXmlLoader;

import java.io.InputStreamReader;

import static java.nio.charset.StandardCharsets.UTF_8;

@ScannerSide
public class ColdFusionSonarRulesDefinition implements RulesDefinition {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
package com.stepstone.sonar.plugin.coldfusion;

import com.stepstone.sonar.plugin.coldfusion.ColdFusionPlugin;
import com.stepstone.sonar.plugin.coldfusion.ColdFusionSensor;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.mockito.Mockito;
import org.sonar.api.SonarQubeSide;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.internal.DefaultFileSystem;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
import org.sonar.api.batch.sensor.internal.SensorContextTester;
import org.sonar.api.batch.sensor.measure.Measure;
import org.sonar.api.internal.SonarRuntimeImpl;
import org.sonar.api.internal.apachecommons.codec.Charsets;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.FileLinesContext;
import org.sonar.api.measures.FileLinesContextFactory;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
import org.sonar.api.utils.Version;
import org.sonar.api.utils.command.CommandExecutor;

import java.io.File;
import java.io.IOException;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class ColdfusionSensorTest {

Expand Down

0 comments on commit 18bf7e4

Please sign in to comment.