Showing 38 of 38 total issues
Method run
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public void run() {
final AtomicInteger grp = new AtomicInteger();
final ExecutorService exec = Executors.newCachedThreadPool(
Method exec
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Iterable<Directive> exec(final XML deck) {
final boolean ready = !deck.nodes(
Joiner.on(" and ").join(
"/deck/containers[not(container/@waste)",
Method act
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Response act(final Request req) throws IOException {
final Deck deck = new RqDeck(this.base, req).deck();
final Href home = new Href("/d").path(deck.name());
final PrettyTime pretty = new PrettyTime();
Method regex
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Take regex(final Base base) throws IOException {
return new TkFork(
new FkParams(
PsByFlag.class.getSimpleName(),
Pattern.compile(".+"),
Similar blocks of code found in 2 locations. Consider refactoring. Open
private static Iterable<Directive> container(final String... args)
throws IOException {
if (args.length == 0) {
throw new RsForward(
new RsFlash(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 106.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
private static Iterable<Directive> image(final String... args)
throws IOException {
if (args.length == 0) {
throw new RsForward(
new RsFlash(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 106.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method exec
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void exec(final Iterable<Deck> decks) throws IOException {
final Iterable<String> confs = Iterables.concat(
Iterables.transform(
decks,
Method exec
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public String exec(final String host, final Map<String, String> args)
throws IOException {
final String command = Joiner.on(" && ").join(
Iterables.concat(
Method make
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Take make(final Take take) {
return new TkAuth(
take,
new PsChain(
new TkAppAuth.FakePass(),
Method update
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void update(final String domain, final XML deck)
throws IOException {
// @checkstyle LineLength (1 line)
final String terms = "not(@waste) and @type='green' and @state='alive' and http";
final String servers = Joiner.on(' ').join(
Method repo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Iterable<Directive> repo(final XML deck,
final String... args) throws IOException {
if (args.length == 0) {
throw new RsForward(
new RsFlash(
Similar blocks of code found in 2 locations. Consider refactoring. Open
function () {
$("#wait-icon").hide();
$("#signup-container").html($("#signed-up-container-success").html());
$("#signed-up-container-success").fadeIn(400);
},
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function () {
$("#wait-icon").hide();
$("#signup-container").html($("#signed-up-container-failure").html());
$("#signed-up-container-failure").fadeIn(400);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 61.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method exec
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Iterable<Directive> exec(final XML deck) throws IOException {
final Collection<XML> containers = deck.nodes(
"/deck/containers/container[not(@waste) and @state='dead']"
);
Method build
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String build(final String deck, final XML repo)
throws IOException {
final String name = String.format(
"%s-%08x", deck,
BuildImage.RND.nextInt()
Method add
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void add(final String name) throws IOException {
if (!name.matches("[a-z]{3,12}")) {
throw new IllegalStateException(
String.format(
Method make
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Response make(final String xsl, final Base base,
final Request req, final XeSource... src) throws IOException {
final Response xbl = new RsXembly(
new XeStylesheet(xsl),
new XePage(base, req, src)
Method exec
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Iterable<Directive> exec(final XML deck) throws IOException {
final Collection<XML> images = deck.nodes(
"/deck/images/image[not(@waste)]"
);
Method answer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Iterable<Directive> answer(final XML deck, final String cmd)
throws IOException {
final Directives dirs = new Directives().xpath("/deck");
final String[] parts = cmd.trim().split("\\s+");
if ("domain".equals(parts[0])) {
Method iterate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Iterable<String> iterate(final long since) {
return Iterables.transform(
this.region.table(DyEvents.TBL)
.frame()