Showing 231 of 1,039 total issues
File build_yaml.py
has 1481 lines of code (exceeds 400 allowed). Consider refactoring. Open
from __future__ import absolute_import
from __future__ import print_function
from copy import deepcopy
import datetime
Function parse
has a Cognitive Complexity of 142 (exceeds 7 allowed). Consider refactoring. Open
def parse(self, expr, simplify=False):
"""
Return a boolean expression parsed from `expr` either a unicode string
or tokens iterable.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File boolean.py
has 1126 lines of code (exceeds 400 allowed). Consider refactoring. Open
"""
Boolean expressions algebra.
This module defines a Boolean algebra over the set {TRUE, FALSE} with boolean
variables called Symbols and the boolean functions AND, OR, NOT.
File test_macros_oval.py
has 1022 lines of code (exceeds 400 allowed). Consider refactoring. Open
#!/usr/bin/python3
import argparse
import oval_tester
Function show_profile_stats
has a Cognitive Complexity of 103 (exceeds 7 allowed). Consider refactoring. Open
def show_profile_stats(self, profile, options):
"""Displays statistics for specific profile"""
profile_stats = self.get_profile_stats(profile)
rules_count = profile_stats['rules_count']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function main
has a Cognitive Complexity of 97 (exceeds 7 allowed). Consider refactoring. Open
def main():
global exit_value
(options, args) = parse_options()
xccdffilename = args[0]
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File controls.py
has 910 lines of code (exceeds 400 allowed). Consider refactoring. Open
"""
Common functions for processing Controls in SSG
"""
import collections
File build_profile.py
has 736 lines of code (exceeds 400 allowed). Consider refactoring. Open
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
File xml.py
has 726 lines of code (exceeds 400 allowed). Consider refactoring. Open
"""
Common functions for processing XML in SSG
"""
from __future__ import absolute_import
File utils.py
has 670 lines of code (exceeds 400 allowed). Consider refactoring. Open
"""
Utils functions consumed by SSG
"""
from __future__ import absolute_import
Function absorb
has a Cognitive Complexity of 55 (exceeds 7 allowed). Consider refactoring. Open
def absorb(self, args):
"""
Given an `args` sequence of expressions, return a new list of expression
applying absorption and negative absorption.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function simplify
has a Cognitive Complexity of 51 (exceeds 7 allowed). Consider refactoring. Open
def simplify(self, sort=True):
"""
Return a new simplified expression in canonical form from this
expression.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File release_helper.py
has 606 lines of code (exceeds 400 allowed). Consider refactoring. Open
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Script created to help maintainers during the release process by automating Github tasks.
File rule.py
has 577 lines of code (exceeds 400 allowed). Consider refactoring. Open
from __future__ import print_function
import collections
import contextlib
import fnmatch
File oscap.py
has 576 lines of code (exceeds 400 allowed). Consider refactoring. Open
#!/usr/bin/python3
from __future__ import print_function
import collections
import datetime
Function print_report
has a Cognitive Complexity of 42 (exceeds 7 allowed). Consider refactoring. Open
def print_report(current_dict: dict, baseline_dict: dict = None) -> None:
"""Print report with results of profiling to stdout"""
# If the targets/outputfiles have changed between baseline and current, we are using
# total_time_intersect to calculate delta (ratio of durations of targets) instead of total_time
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _start_operation
has a Cognitive Complexity of 41 (exceeds 7 allowed). Consider refactoring. Open
def _start_operation(self, ast, operation, precedence):
"""
Return an AST where all operations of lower precedence are finalized.
"""
if TRACE_PARSE:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File fix_rules.py
has 544 lines of code (exceeds 400 allowed). Consider refactoring. Open
#!/usr/bin/python3
from __future__ import print_function
import sys
Rule
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class Rule(XCCDFEntity, Templatable):
"""Represents XCCDF Rule
"""
KEYS = dict(
description=lambda: "",
File data.py
has 502 lines of code (exceeds 400 allowed). Consider refactoring. Open
import string
HEADERS = [
'IA Control', 'CCI', 'SRGID', 'STIGID', 'SRG Requirement', 'Requirement',
'SRG VulDiscussion', 'Vul Discussion', 'Status', 'SRG Check', 'Check', 'SRG Fix',