• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pkiraly / metadata-qa-marc / #1527

22 Aug 2025 02:21PM UTC coverage: 90.345%. Remained the same
#1527

push

pkiraly
Improve timeline handling

5191 of 6416 new or added lines in 219 files covered. (80.91%)

886 existing lines in 78 files now uncovered.

36717 of 40641 relevant lines covered (90.34%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/de/gwdg/metadataqa/marc/cli/utils/MappingToMarkdown.java
1
package de.gwdg.metadataqa.marc.cli.utils;
2

3
import de.gwdg.metadataqa.marc.definition.structure.DataFieldDefinition;
4
import de.gwdg.metadataqa.marc.definition.structure.SubfieldDefinition;
5
import de.gwdg.metadataqa.marc.utils.MarcTagLister;
6

7
import java.lang.reflect.InvocationTargetException;
8
import java.lang.reflect.Method;
9
import java.util.List;
10
import java.util.logging.Level;
11
import java.util.logging.Logger;
12

UNCOV
13
public class MappingToMarkdown {
×
14

UNCOV
15
  private static final Logger logger = Logger.getLogger(MappingToMarkdown.class.getCanonicalName());
×
16

17
  public static void main(String[] args) {
UNCOV
18
    List<Class<? extends DataFieldDefinition>> tags = MarcTagLister.listTags();
×
19

20
    for (Class<? extends DataFieldDefinition> tagClass : tags) {
×
21
      if (tagClass.getCanonicalName().contains("oclctags"))
×
UNCOV
22
        continue;
×
23

24
      Method getInstance = null;
×
UNCOV
25
      DataFieldDefinition tag = null;
×
26
      try {
27
        getInstance = tagClass.getMethod("getInstance");
×
28
        tag = (DataFieldDefinition) getInstance.invoke(tagClass);
×
UNCOV
29
        tagToMarkDown(tag);
×
30

31
      } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
×
32
        logger.log(Level.WARNING, "document", e);
×
33
      }
×
34
    }
×
UNCOV
35
  }
×
36

37
  private static void tagToMarkDown(DataFieldDefinition tag) {
38
    System.out.printf("|  |  |  |%n");
×
39
    System.out.printf("| **`%s`** | **`%s`** | **%s** |%n",
×
40
      tag.getTag(),
×
41
      tag.getIndexTag(),
×
42
      tag.getLabel());
×
43
    if (tag.getInd1().exists() || tag.getInd2().exists())
×
44
      System.out.printf("|  | indicators |  |%n");
×
45
    if (tag.getInd1().exists())
×
46
      System.out.printf("| `%s$ind1` | `%s_%s` | %s |%n",
×
47
        tag.getTag(),
×
48
        tag.getIndexTag(), tag.getInd1().getIndexTag(),
×
49
        tag.getInd1().getLabel());
×
50
    if (tag.getInd2().exists())
×
51
      System.out.printf("| `%s$ind2` | `%s_%s` | %s |%n",
×
52
        tag.getTag(),
×
53
        tag.getIndexTag(), tag.getInd2().getIndexTag(),
×
54
        tag.getInd2().getLabel());
×
55
    System.out.printf("|  | data subfields |  |%n");
×
UNCOV
56
    for (SubfieldDefinition subfield : tag.getSubfields()) {
×
57
      // This codeForIndex doesn't contain underscore so it's added in the format string
NEW
58
      System.out.printf("| `%s$%s` | `%s_%s` | %s |%n",
×
59
        tag.getTag(), subfield.getCode(),
×
NEW
60
        tag.getIndexTag(), subfield.getCodeForIndex(),
×
61
        subfield.getLabel());
×
62
    }
×
63
  }
×
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc