Code Duplication    Length = 15-33 lines in 2 locations

build-scripts/build_xccdf.py 1 location

@@ 17-49 (lines=33) @@
14
import ssg.products
15
16
17
def parse_args():
18
    parser = argparse.ArgumentParser(
19
        description="Converts SCAP Security Guide YAML benchmark data "
20
        "(benchmark, rules, groups) to XCCDF Shorthand Format"
21
    )
22
    parser.add_argument(
23
        "--build-config-yaml", required=True,
24
        help="YAML file with information about the build configuration. "
25
        "e.g.: ~/scap-security-guide/build/build_config.yml"
26
    )
27
    parser.add_argument(
28
        "--product-yaml", required=True,
29
        help="YAML file with information about the product we are building. "
30
        "e.g.: ~/scap-security-guide/rhel7/product.yml"
31
    )
32
    parser.add_argument(
33
        "--xccdf", required=True,
34
        help="Output XCCDF file. "
35
        "e.g.:  ~/scap-security-guide/build/rhel7/ssg-rhel7-xccdf.xml"
36
    )
37
    parser.add_argument(
38
        "--ocil", required=True,
39
        help="Output OCIL file. "
40
        "e.g.:  ~/scap-security-guide/build/rhel7/ssg-rhel7-ocil.xml"
41
    )
42
    parser.add_argument(
43
        "--oval", required=True,
44
        help="Output OVAL file. "
45
        "e.g.:  ~/scap-security-guide/build/rhel7/ssg-rhel7-oval.xml"
46
    )
47
    parser.add_argument("--resolved-base",
48
                        help="To which directory to put processed rule/group/value YAMLs.")
49
    return parser.parse_args()
50
51
52
def main():

build-scripts/compose_ds.py 1 location

@@ 168-182 (lines=15) @@
165
        ds_checks.append(component_ref_feed)
166
167
168
def parse_args():
169
    parser = argparse.ArgumentParser(description="Compose an SCAP source data \
170
        stream from individual SCAP components")
171
    parser.add_argument("--xccdf", help="XCCDF 1.2 checklist file name")
172
    parser.add_argument("--oval", help="OVAL file name")
173
    parser.add_argument("--ocil", help="OCIL file name")
174
    parser.add_argument("--cpe-dict", help="CPE dictionary file name")
175
    parser.add_argument("--cpe-oval", help="CPE OVAL file name")
176
    parser.add_argument("--enable-sce", action='store_true', help="Enable building sce data")
177
    parser.add_argument(
178
        "--output-12", help="Output SCAP 1.2 source data stream file name")
179
    parser.add_argument(
180
        "--output-13", required=True,
181
        help="Output SCAP 1.3 source data stream file name")
182
    return parser.parse_args()
183
184
185
def get_timestamp(file_name):