yegor256/thindeck

View on GitHub

Showing 28 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(
Severity: Major
Found in src/main/java/com/thindeck/Routine.java - About 2 hrs to fix

    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)",
    Severity: Minor
    Found in src/main/java/com/thindeck/agents/Swap.java - About 1 hr to fix

      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(".+"),
      Severity: Minor
      Found in src/main/java/com/thindeck/cockpit/TkApp.java - About 1 hr to fix

        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();
        Severity: Minor
        Found in src/main/java/com/thindeck/cockpit/deck/TkIndex.java - About 1 hr to fix

          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,
          Severity: Minor
          Found in src/main/java/com/thindeck/bosses/CleanNginx.java - About 1 hr to fix

            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(
            Severity: Minor
            Found in src/main/java/com/thindeck/agents/Script.java - About 1 hr to fix

              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(
              Severity: Minor
              Found in src/main/java/com/thindeck/agents/UpdateNginx.java - About 1 hr to fix

                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(),
                Severity: Minor
                Found in src/main/java/com/thindeck/cockpit/TkAppAuth.java - About 1 hr to fix

                  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(
                  Severity: Minor
                  Found in src/main/java/com/thindeck/cockpit/deck/TkCommand.java - About 1 hr to fix

                    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']"
                            );
                    Severity: Minor
                    Found in src/main/java/com/thindeck/agents/BuryContainers.java - About 1 hr to fix

                      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()
                      Severity: Minor
                      Found in src/main/java/com/thindeck/agents/BuildImage.java - About 1 hr to fix

                        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(
                        Severity: Minor
                        Found in src/main/java/com/thindeck/dynamo/DyDecks.java - About 1 hr to fix

                          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)
                          Severity: Minor
                          Found in src/main/java/com/thindeck/cockpit/RsPage.java - About 1 hr to fix

                            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)]"
                                    );
                            Severity: Minor
                            Found in src/main/java/com/thindeck/agents/StartDocker.java - About 1 hr to fix

                              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])) {
                              Severity: Minor
                              Found in src/main/java/com/thindeck/cockpit/deck/TkCommand.java - About 1 hr to fix

                                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()
                                Severity: Minor
                                Found in src/main/java/com/thindeck/dynamo/DyEvents.java - About 1 hr to fix

                                  Method exec has 28 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[@waste and @state='alive']"
                                          );
                                  Severity: Minor
                                  Found in src/main/java/com/thindeck/agents/TerminateDocker.java - About 1 hr to fix

                                    Method exec has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        @Override
                                        public Iterable<Directive> exec(final XML deck) throws IOException {
                                            final Directives dirs = new Directives();
                                            final Collection<XML> containers = deck.nodes(
                                                "/deck/containers/container[host and http]"
                                    Severity: Minor
                                    Found in src/main/java/com/thindeck/agents/CheckState.java - About 1 hr to fix

                                      Method image has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private static Iterable<Directive> image(final String... args)
                                              throws IOException {
                                              if (args.length == 0) {
                                                  throw new RsForward(
                                                      new RsFlash(
                                      Severity: Minor
                                      Found in src/main/java/com/thindeck/cockpit/deck/TkCommand.java - About 1 hr to fix

                                        Method domain has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private static Iterable<Directive> domain(final String... args)
                                                throws IOException {
                                                if (args.length == 0) {
                                                    throw new RsForward(
                                                        new RsFlash(
                                        Severity: Minor
                                        Found in src/main/java/com/thindeck/cockpit/deck/TkCommand.java - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language