We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
No colour option
**Describe the issue**
Checkov cli output is heavily targeted for a dark background. Using a light theme makes it very hard to read.
Is there a way to remove color or control the theme used?

**Version:**
 - Checkov Version 2.0.1050

**Additional context**
Small search I found you use termcolor: https://github.com/bridgecrewio/checkov/blob/d55c68ff909c65e341e91938c13a155c99601f5f/checkov/common/output/report.py#L16
but I couldn't find a way to "mute" it. Maybe simply overwriting that function "colored" with a dummy lambda would do it.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `checkov/common/output/record.py`
Content:
```
1 import os
2 import re
3 from pathlib import Path
4 from typing import Union, List, Tuple, Optional, Dict, Any
5 
6 from colorama import init, Fore, Style
7 from termcolor import colored
8 
9 from checkov.common.bridgecrew.severities import Severity
10 from checkov.common.models.enums import CheckResult
11 from checkov.common.typing import _CheckResult
12 from checkov.common.util.file_utils import convert_to_unix_path
13 from checkov.common.util.type_forcers import force_int
14 
15 init(autoreset=True)
16 
17 DEFAULT_SEVERITY = "none"  # equivalent to a score of 0.0 in the CVSS v3.0 Ratings
18 
19 OUTPUT_CODE_LINE_LIMIT = force_int(os.getenv('CHECKOV_OUTPUT_CODE_LINE_LIMIT')) or 50
20 
21 class Record:
22     check_id = ""
23     check_name = ""
24     check_result = None
25     check_class = ""
26     code_block: List[Tuple[int, str]] = []
27     file_path = ""
28     file_line_range: List[int] = []
29     caller_file_path = None  # When created from a module
30     caller_file_line_range = None  # When created from a module
31     resource = ""
32     guideline = None
33     fixed_definition = None
34     entity_tags = None
35     severity = None
36     description = None  # used by SARIF output
37     short_description = None  # used by SARIF output
38     vulnerability_details = None  # Stores package vulnerability details
39     connected_node = None
40 
41     def __init__(
42         self,
43         check_id: str,
44         check_name: str,
45         check_result: _CheckResult,
46         code_block: List[Tuple[int, str]],
47         file_path: str,
48         file_line_range: List[int],
49         resource: str,
50         evaluations: Optional[Dict[str, Any]],
51         check_class: str,
52         file_abs_path: str,
53         entity_tags: Optional[Dict[str, str]] = None,
54         caller_file_path: Optional[str] = None,
55         caller_file_line_range: Optional[Tuple[int, int]] = None,
56         bc_check_id: Optional[str] = None,
57         resource_address: Optional[str] = None,
58         severity: Optional[Severity] = None,
59         bc_category: Optional[str] = None,
60         benchmarks: Optional[Dict[str, list]] = None,
61         description: Optional[str] = None,
62         short_description: Optional[str] = None,
63         vulnerability_details: Optional[Dict[str, Any]] = None,
64         connected_node: Optional[Dict[str, Any]] = None
65     ) -> None:
66         """
67         :param evaluations: A dict with the key being the variable name, value being a dict containing:
68                              - 'var_file'
69                              - 'value'
70                              - 'definitions', a list of dicts which contain 'definition_expression'
71         """
72         self.check_id = check_id
73         self.bc_check_id = bc_check_id
74         self.check_name = check_name
75         self.check_result = check_result
76         self.code_block = code_block
77         self.file_path = file_path
78         self.file_abs_path = file_abs_path
79         self.repo_file_path = self._determine_repo_file_path(file_abs_path)
80         self.file_line_range = file_line_range
81         self.resource = resource
82         self.evaluations = evaluations
83         self.check_class = check_class
84         self.fixed_definition = None
85         self.entity_tags = entity_tags
86         self.caller_file_path = caller_file_path
87         self.caller_file_line_range = caller_file_line_range
88         self.resource_address = resource_address
89         self.severity = severity
90         self.bc_category = bc_category
91         self.benchmarks = benchmarks
92         self.description = description
93         self.short_description = short_description
94         self.vulnerability_details = vulnerability_details
95         self.connected_node = connected_node
96 
97     @staticmethod
98     def _determine_repo_file_path(file_path: Union[str, "os.PathLike[str]"]) -> str:
99         # matches file paths given in the BC platform and should always be a unix path
100         repo_file_path = Path(file_path)
101         if Path.cwd().drive == repo_file_path.drive:
102             return convert_to_unix_path(f"/{os.path.relpath(repo_file_path)}").replace("/..", "")
103 
104         return f"/{'/'.join(repo_file_path.parts[1:])}"
105 
106     def set_guideline(self, guideline: Optional[str]) -> None:
107         self.guideline = guideline
108 
109     @staticmethod
110     def _trim_special_chars(expression: str) -> str:
111         return "".join(re.findall(re.compile(r"[^ ${\}]+"), expression))
112 
113     def _is_expression_in_code_lines(self, expression: str) -> bool:
114         stripped_expression = self._trim_special_chars(expression)
115         return any(stripped_expression in self._trim_special_chars(line) for (_, line) in self.code_block)
116 
117     @staticmethod
118     def _code_line_string(code_block: List[Tuple[int, str]], colorized: bool = True) -> str:
119         code_output = []
120         color_codes = (Fore.WHITE if colorized else "", Fore.YELLOW if colorized else "")
121         last_line_number_len = len(str(code_block[-1][0]))
122 
123         if len(code_block) >= OUTPUT_CODE_LINE_LIMIT:
124             return f'\t\t{color_codes[1]}Code lines for this resource are too many. ' \
125                    f'Please use IDE of your choice to review the file.'
126 
127         for line_num, line in code_block:
128             spaces = " " * (last_line_number_len - len(str(line_num)))
129             if line.lstrip().startswith("#"):
130                 code_output.append(f"\t\t{color_codes[0]}{line_num}{spaces} | {line}")
131             else:
132                 code_output.append(f"\t\t{color_codes[0]}{line_num}{spaces} | {color_codes[1]}{line}")
133         return "".join(code_output)
134 
135     def to_string(self, compact: bool = False, use_bc_ids: bool = False) -> str:
136         status = ""
137         evaluation_message = ""
138         status_color = "white"
139         suppress_comment = ""
140         if self.check_result["result"] == CheckResult.PASSED:
141             status = CheckResult.PASSED.name
142             status_color = "green"
143         elif self.check_result["result"] == CheckResult.FAILED:
144             status = CheckResult.FAILED.name
145             status_color = "red"
146         elif self.check_result["result"] == CheckResult.SKIPPED:
147             status = CheckResult.SKIPPED.name
148             status_color = "blue"
149             suppress_comment = "\tSuppress comment: {}\n".format(self.check_result["suppress_comment"])
150 
151         check_message = colored('Check: {}: "{}"\n'.format(self.get_output_id(use_bc_ids), self.check_name), "white")
152         guideline_message = ""
153         if self.guideline:
154             guideline_message = (
155                 "\tGuide: "
156                 + Style.BRIGHT
157                 + colored(f"{self.guideline}\n", "blue", attrs=["underline"])
158                 + Style.RESET_ALL
159             )
160 
161         severity_message = f'\tSeverity: {self.severity.name}\n' if self.severity else ''
162 
163         file_details = colored(
164             "\tFile: {}:{}\n".format(self.file_path, "-".join([str(x) for x in self.file_line_range])), "magenta"
165         )
166         code_lines = ""
167         if self.code_block:
168             code_lines = "\n{}\n".format("".join([self._code_line_string(self.code_block)]))
169         caller_file_details = ""
170         if self.caller_file_path and self.caller_file_line_range:
171             caller_file_details = colored(
172                 "\tCalling File: {}:{}\n".format(
173                     self.caller_file_path, "-".join([str(x) for x in self.caller_file_line_range])
174                 ),
175                 "magenta",
176             )
177         if self.evaluations:
178             for (var_name, var_evaluations) in self.evaluations.items():
179                 var_file = var_evaluations["var_file"]
180                 var_definitions = var_evaluations["definitions"]
181                 for definition_obj in var_definitions:
182                     definition_expression = definition_obj["definition_expression"]
183                     if self._is_expression_in_code_lines(definition_expression):
184                         evaluation_message = evaluation_message + colored(
185                             f'\tVariable {colored(var_name, "yellow")} (of {var_file}) evaluated to value "{colored(var_evaluations["value"], "yellow")}" '
186                             f'in expression: {colored(definition_obj["definition_name"] + " = ", "yellow")}{colored(definition_obj["definition_expression"], "yellow")}\n',
187                             "white",
188                         )
189 
190         status_message = colored("\t{} for resource: {}\n".format(status, self.resource), status_color)
191         if self.check_result["result"] == CheckResult.FAILED and code_lines and not compact:
192             return f"{check_message}{status_message}{severity_message}{file_details}{caller_file_details}{guideline_message}{code_lines}{evaluation_message}"
193 
194         if self.check_result["result"] == CheckResult.SKIPPED:
195             return f"{check_message}{status_message}{severity_message}{suppress_comment}{file_details}{caller_file_details}{guideline_message}"
196         else:
197             return f"{check_message}{status_message}{severity_message}{file_details}{caller_file_details}{evaluation_message}{guideline_message}"
198 
199     def __str__(self) -> str:
200         return self.to_string()
201 
202     def get_output_id(self, use_bc_ids: bool) -> str:
203         return self.bc_check_id if self.bc_check_id and use_bc_ids else self.check_id
204 
205     def get_unique_string(self) -> str:
206         return f"{self.check_id}.{self.check_result}.{self.file_abs_path}.{self.file_line_range}.{self.resource}"
207
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/checkov/common/output/record.py b/checkov/common/output/record.py
--- a/checkov/common/output/record.py
+++ b/checkov/common/output/record.py
@@ -18,6 +18,8 @@
 
 OUTPUT_CODE_LINE_LIMIT = force_int(os.getenv('CHECKOV_OUTPUT_CODE_LINE_LIMIT')) or 50
 
+ANSI_COLORS_DISABLED = bool(os.getenv('ANSI_COLORS_DISABLED'))
+
 class Record:
     check_id = ""
     check_name = ""
@@ -165,7 +167,7 @@
         )
         code_lines = ""
         if self.code_block:
-            code_lines = "\n{}\n".format("".join([self._code_line_string(self.code_block)]))
+            code_lines = "\n{}\n".format("".join([self._code_line_string(self.code_block, not(ANSI_COLORS_DISABLED))]))
         caller_file_details = ""
         if self.caller_file_path and self.caller_file_line_range:
             caller_file_details = colored(

{"golden_diff": "diff --git a/checkov/common/output/record.py b/checkov/common/output/record.py\n--- a/checkov/common/output/record.py\n+++ b/checkov/common/output/record.py\n@@ -18,6 +18,8 @@\n \n OUTPUT_CODE_LINE_LIMIT = force_int(os.getenv('CHECKOV_OUTPUT_CODE_LINE_LIMIT')) or 50\n \n+ANSI_COLORS_DISABLED = bool(os.getenv('ANSI_COLORS_DISABLED'))\n+\n class Record:\n     check_id = \"\"\n     check_name = \"\"\n@@ -165,7 +167,7 @@\n         )\n         code_lines = \"\"\n         if self.code_block:\n-            code_lines = \"\\n{}\\n\".format(\"\".join([self._code_line_string(self.code_block)]))\n+            code_lines = \"\\n{}\\n\".format(\"\".join([self._code_line_string(self.code_block, not(ANSI_COLORS_DISABLED))]))\n         caller_file_details = \"\"\n         if self.caller_file_path and self.caller_file_line_range:\n             caller_file_details = colored(\n", "issue": "No colour option\n**Describe the issue**\r\nCheckov cli output is heavily targeted for a dark background. Using a light theme makes it very hard to read.\r\nIs there a way to remove color or control the theme used?\r\n\r\n**Version:**\r\n - Checkov Version 2.0.1050\r\n\r\n**Additional context**\r\nSmall search I found you use termcolor: https://github.com/bridgecrewio/checkov/blob/d55c68ff909c65e341e91938c13a155c99601f5f/checkov/common/output/report.py#L16\r\nbut I couldn't find a way to \"mute\" it. Maybe simply overwriting that function \"colored\" with a dummy lambda would do it.\r\n\n", "before_files": [{"content": "import os\nimport re\nfrom pathlib import Path\nfrom typing import Union, List, Tuple, Optional, Dict, Any\n\nfrom colorama import init, Fore, Style\nfrom termcolor import colored\n\nfrom checkov.common.bridgecrew.severities import Severity\nfrom checkov.common.models.enums import CheckResult\nfrom checkov.common.typing import _CheckResult\nfrom checkov.common.util.file_utils import convert_to_unix_path\nfrom checkov.common.util.type_forcers import force_int\n\ninit(autoreset=True)\n\nDEFAULT_SEVERITY = \"none\"  # equivalent to a score of 0.0 in the CVSS v3.0 Ratings\n\nOUTPUT_CODE_LINE_LIMIT = force_int(os.getenv('CHECKOV_OUTPUT_CODE_LINE_LIMIT')) or 50\n\nclass Record:\n    check_id = \"\"\n    check_name = \"\"\n    check_result = None\n    check_class = \"\"\n    code_block: List[Tuple[int, str]] = []\n    file_path = \"\"\n    file_line_range: List[int] = []\n    caller_file_path = None  # When created from a module\n    caller_file_line_range = None  # When created from a module\n    resource = \"\"\n    guideline = None\n    fixed_definition = None\n    entity_tags = None\n    severity = None\n    description = None  # used by SARIF output\n    short_description = None  # used by SARIF output\n    vulnerability_details = None  # Stores package vulnerability details\n    connected_node = None\n\n    def __init__(\n        self,\n        check_id: str,\n        check_name: str,\n        check_result: _CheckResult,\n        code_block: List[Tuple[int, str]],\n        file_path: str,\n        file_line_range: List[int],\n        resource: str,\n        evaluations: Optional[Dict[str, Any]],\n        check_class: str,\n        file_abs_path: str,\n        entity_tags: Optional[Dict[str, str]] = None,\n        caller_file_path: Optional[str] = None,\n        caller_file_line_range: Optional[Tuple[int, int]] = None,\n        bc_check_id: Optional[str] = None,\n        resource_address: Optional[str] = None,\n        severity: Optional[Severity] = None,\n        bc_category: Optional[str] = None,\n        benchmarks: Optional[Dict[str, list]] = None,\n        description: Optional[str] = None,\n        short_description: Optional[str] = None,\n        vulnerability_details: Optional[Dict[str, Any]] = None,\n        connected_node: Optional[Dict[str, Any]] = None\n    ) -> None:\n        \"\"\"\n        :param evaluations: A dict with the key being the variable name, value being a dict containing:\n                             - 'var_file'\n                             - 'value'\n                             - 'definitions', a list of dicts which contain 'definition_expression'\n        \"\"\"\n        self.check_id = check_id\n        self.bc_check_id = bc_check_id\n        self.check_name = check_name\n        self.check_result = check_result\n        self.code_block = code_block\n        self.file_path = file_path\n        self.file_abs_path = file_abs_path\n        self.repo_file_path = self._determine_repo_file_path(file_abs_path)\n        self.file_line_range = file_line_range\n        self.resource = resource\n        self.evaluations = evaluations\n        self.check_class = check_class\n        self.fixed_definition = None\n        self.entity_tags = entity_tags\n        self.caller_file_path = caller_file_path\n        self.caller_file_line_range = caller_file_line_range\n        self.resource_address = resource_address\n        self.severity = severity\n        self.bc_category = bc_category\n        self.benchmarks = benchmarks\n        self.description = description\n        self.short_description = short_description\n        self.vulnerability_details = vulnerability_details\n        self.connected_node = connected_node\n\n    @staticmethod\n    def _determine_repo_file_path(file_path: Union[str, \"os.PathLike[str]\"]) -> str:\n        # matches file paths given in the BC platform and should always be a unix path\n        repo_file_path = Path(file_path)\n        if Path.cwd().drive == repo_file_path.drive:\n            return convert_to_unix_path(f\"/{os.path.relpath(repo_file_path)}\").replace(\"/..\", \"\")\n\n        return f\"/{'/'.join(repo_file_path.parts[1:])}\"\n\n    def set_guideline(self, guideline: Optional[str]) -> None:\n        self.guideline = guideline\n\n    @staticmethod\n    def _trim_special_chars(expression: str) -> str:\n        return \"\".join(re.findall(re.compile(r\"[^ ${\\}]+\"), expression))\n\n    def _is_expression_in_code_lines(self, expression: str) -> bool:\n        stripped_expression = self._trim_special_chars(expression)\n        return any(stripped_expression in self._trim_special_chars(line) for (_, line) in self.code_block)\n\n    @staticmethod\n    def _code_line_string(code_block: List[Tuple[int, str]], colorized: bool = True) -> str:\n        code_output = []\n        color_codes = (Fore.WHITE if colorized else \"\", Fore.YELLOW if colorized else \"\")\n        last_line_number_len = len(str(code_block[-1][0]))\n\n        if len(code_block) >= OUTPUT_CODE_LINE_LIMIT:\n            return f'\\t\\t{color_codes[1]}Code lines for this resource are too many. ' \\\n                   f'Please use IDE of your choice to review the file.'\n\n        for line_num, line in code_block:\n            spaces = \" \" * (last_line_number_len - len(str(line_num)))\n            if line.lstrip().startswith(\"#\"):\n                code_output.append(f\"\\t\\t{color_codes[0]}{line_num}{spaces} | {line}\")\n            else:\n                code_output.append(f\"\\t\\t{color_codes[0]}{line_num}{spaces} | {color_codes[1]}{line}\")\n        return \"\".join(code_output)\n\n    def to_string(self, compact: bool = False, use_bc_ids: bool = False) -> str:\n        status = \"\"\n        evaluation_message = \"\"\n        status_color = \"white\"\n        suppress_comment = \"\"\n        if self.check_result[\"result\"] == CheckResult.PASSED:\n            status = CheckResult.PASSED.name\n            status_color = \"green\"\n        elif self.check_result[\"result\"] == CheckResult.FAILED:\n            status = CheckResult.FAILED.name\n            status_color = \"red\"\n        elif self.check_result[\"result\"] == CheckResult.SKIPPED:\n            status = CheckResult.SKIPPED.name\n            status_color = \"blue\"\n            suppress_comment = \"\\tSuppress comment: {}\\n\".format(self.check_result[\"suppress_comment\"])\n\n        check_message = colored('Check: {}: \"{}\"\\n'.format(self.get_output_id(use_bc_ids), self.check_name), \"white\")\n        guideline_message = \"\"\n        if self.guideline:\n            guideline_message = (\n                \"\\tGuide: \"\n                + Style.BRIGHT\n                + colored(f\"{self.guideline}\\n\", \"blue\", attrs=[\"underline\"])\n                + Style.RESET_ALL\n            )\n\n        severity_message = f'\\tSeverity: {self.severity.name}\\n' if self.severity else ''\n\n        file_details = colored(\n            \"\\tFile: {}:{}\\n\".format(self.file_path, \"-\".join([str(x) for x in self.file_line_range])), \"magenta\"\n        )\n        code_lines = \"\"\n        if self.code_block:\n            code_lines = \"\\n{}\\n\".format(\"\".join([self._code_line_string(self.code_block)]))\n        caller_file_details = \"\"\n        if self.caller_file_path and self.caller_file_line_range:\n            caller_file_details = colored(\n                \"\\tCalling File: {}:{}\\n\".format(\n                    self.caller_file_path, \"-\".join([str(x) for x in self.caller_file_line_range])\n                ),\n                \"magenta\",\n            )\n        if self.evaluations:\n            for (var_name, var_evaluations) in self.evaluations.items():\n                var_file = var_evaluations[\"var_file\"]\n                var_definitions = var_evaluations[\"definitions\"]\n                for definition_obj in var_definitions:\n                    definition_expression = definition_obj[\"definition_expression\"]\n                    if self._is_expression_in_code_lines(definition_expression):\n                        evaluation_message = evaluation_message + colored(\n                            f'\\tVariable {colored(var_name, \"yellow\")} (of {var_file}) evaluated to value \"{colored(var_evaluations[\"value\"], \"yellow\")}\" '\n                            f'in expression: {colored(definition_obj[\"definition_name\"] + \" = \", \"yellow\")}{colored(definition_obj[\"definition_expression\"], \"yellow\")}\\n',\n                            \"white\",\n                        )\n\n        status_message = colored(\"\\t{} for resource: {}\\n\".format(status, self.resource), status_color)\n        if self.check_result[\"result\"] == CheckResult.FAILED and code_lines and not compact:\n            return f\"{check_message}{status_message}{severity_message}{file_details}{caller_file_details}{guideline_message}{code_lines}{evaluation_message}\"\n\n        if self.check_result[\"result\"] == CheckResult.SKIPPED:\n            return f\"{check_message}{status_message}{severity_message}{suppress_comment}{file_details}{caller_file_details}{guideline_message}\"\n        else:\n            return f\"{check_message}{status_message}{severity_message}{file_details}{caller_file_details}{evaluation_message}{guideline_message}\"\n\n    def __str__(self) -> str:\n        return self.to_string()\n\n    def get_output_id(self, use_bc_ids: bool) -> str:\n        return self.bc_check_id if self.bc_check_id and use_bc_ids else self.check_id\n\n    def get_unique_string(self) -> str:\n        return f\"{self.check_id}.{self.check_result}.{self.file_abs_path}.{self.file_line_range}.{self.resource}\"\n", "path": "checkov/common/output/record.py"}], "after_files": [{"content": "import os\nimport re\nfrom pathlib import Path\nfrom typing import Union, List, Tuple, Optional, Dict, Any\n\nfrom colorama import init, Fore, Style\nfrom termcolor import colored\n\nfrom checkov.common.bridgecrew.severities import Severity\nfrom checkov.common.models.enums import CheckResult\nfrom checkov.common.typing import _CheckResult\nfrom checkov.common.util.file_utils import convert_to_unix_path\nfrom checkov.common.util.type_forcers import force_int\n\ninit(autoreset=True)\n\nDEFAULT_SEVERITY = \"none\"  # equivalent to a score of 0.0 in the CVSS v3.0 Ratings\n\nOUTPUT_CODE_LINE_LIMIT = force_int(os.getenv('CHECKOV_OUTPUT_CODE_LINE_LIMIT')) or 50\n\nANSI_COLORS_DISABLED = bool(os.getenv('ANSI_COLORS_DISABLED'))\n\nclass Record:\n    check_id = \"\"\n    check_name = \"\"\n    check_result = None\n    check_class = \"\"\n    code_block: List[Tuple[int, str]] = []\n    file_path = \"\"\n    file_line_range: List[int] = []\n    caller_file_path = None  # When created from a module\n    caller_file_line_range = None  # When created from a module\n    resource = \"\"\n    guideline = None\n    fixed_definition = None\n    entity_tags = None\n    severity = None\n    description = None  # used by SARIF output\n    short_description = None  # used by SARIF output\n    vulnerability_details = None  # Stores package vulnerability details\n    connected_node = None\n\n    def __init__(\n        self,\n        check_id: str,\n        check_name: str,\n        check_result: _CheckResult,\n        code_block: List[Tuple[int, str]],\n        file_path: str,\n        file_line_range: List[int],\n        resource: str,\n        evaluations: Optional[Dict[str, Any]],\n        check_class: str,\n        file_abs_path: str,\n        entity_tags: Optional[Dict[str, str]] = None,\n        caller_file_path: Optional[str] = None,\n        caller_file_line_range: Optional[Tuple[int, int]] = None,\n        bc_check_id: Optional[str] = None,\n        resource_address: Optional[str] = None,\n        severity: Optional[Severity] = None,\n        bc_category: Optional[str] = None,\n        benchmarks: Optional[Dict[str, list]] = None,\n        description: Optional[str] = None,\n        short_description: Optional[str] = None,\n        vulnerability_details: Optional[Dict[str, Any]] = None,\n        connected_node: Optional[Dict[str, Any]] = None\n    ) -> None:\n        \"\"\"\n        :param evaluations: A dict with the key being the variable name, value being a dict containing:\n                             - 'var_file'\n                             - 'value'\n                             - 'definitions', a list of dicts which contain 'definition_expression'\n        \"\"\"\n        self.check_id = check_id\n        self.bc_check_id = bc_check_id\n        self.check_name = check_name\n        self.check_result = check_result\n        self.code_block = code_block\n        self.file_path = file_path\n        self.file_abs_path = file_abs_path\n        self.repo_file_path = self._determine_repo_file_path(file_abs_path)\n        self.file_line_range = file_line_range\n        self.resource = resource\n        self.evaluations = evaluations\n        self.check_class = check_class\n        self.fixed_definition = None\n        self.entity_tags = entity_tags\n        self.caller_file_path = caller_file_path\n        self.caller_file_line_range = caller_file_line_range\n        self.resource_address = resource_address\n        self.severity = severity\n        self.bc_category = bc_category\n        self.benchmarks = benchmarks\n        self.description = description\n        self.short_description = short_description\n        self.vulnerability_details = vulnerability_details\n        self.connected_node = connected_node\n\n    @staticmethod\n    def _determine_repo_file_path(file_path: Union[str, \"os.PathLike[str]\"]) -> str:\n        # matches file paths given in the BC platform and should always be a unix path\n        repo_file_path = Path(file_path)\n        if Path.cwd().drive == repo_file_path.drive:\n            return convert_to_unix_path(f\"/{os.path.relpath(repo_file_path)}\").replace(\"/..\", \"\")\n\n        return f\"/{'/'.join(repo_file_path.parts[1:])}\"\n\n    def set_guideline(self, guideline: Optional[str]) -> None:\n        self.guideline = guideline\n\n    @staticmethod\n    def _trim_special_chars(expression: str) -> str:\n        return \"\".join(re.findall(re.compile(r\"[^ ${\\}]+\"), expression))\n\n    def _is_expression_in_code_lines(self, expression: str) -> bool:\n        stripped_expression = self._trim_special_chars(expression)\n        return any(stripped_expression in self._trim_special_chars(line) for (_, line) in self.code_block)\n\n    @staticmethod\n    def _code_line_string(code_block: List[Tuple[int, str]], colorized: bool = True) -> str:\n        code_output = []\n        color_codes = (Fore.WHITE if colorized else \"\", Fore.YELLOW if colorized else \"\")\n        last_line_number_len = len(str(code_block[-1][0]))\n\n        if len(code_block) >= OUTPUT_CODE_LINE_LIMIT:\n            return f'\\t\\t{color_codes[1]}Code lines for this resource are too many. ' \\\n                   f'Please use IDE of your choice to review the file.'\n\n        for line_num, line in code_block:\n            spaces = \" \" * (last_line_number_len - len(str(line_num)))\n            if line.lstrip().startswith(\"#\"):\n                code_output.append(f\"\\t\\t{color_codes[0]}{line_num}{spaces} | {line}\")\n            else:\n                code_output.append(f\"\\t\\t{color_codes[0]}{line_num}{spaces} | {color_codes[1]}{line}\")\n        return \"\".join(code_output)\n\n    def to_string(self, compact: bool = False, use_bc_ids: bool = False) -> str:\n        status = \"\"\n        evaluation_message = \"\"\n        status_color = \"white\"\n        suppress_comment = \"\"\n        if self.check_result[\"result\"] == CheckResult.PASSED:\n            status = CheckResult.PASSED.name\n            status_color = \"green\"\n        elif self.check_result[\"result\"] == CheckResult.FAILED:\n            status = CheckResult.FAILED.name\n            status_color = \"red\"\n        elif self.check_result[\"result\"] == CheckResult.SKIPPED:\n            status = CheckResult.SKIPPED.name\n            status_color = \"blue\"\n            suppress_comment = \"\\tSuppress comment: {}\\n\".format(self.check_result[\"suppress_comment\"])\n\n        check_message = colored('Check: {}: \"{}\"\\n'.format(self.get_output_id(use_bc_ids), self.check_name), \"white\")\n        guideline_message = \"\"\n        if self.guideline:\n            guideline_message = (\n                \"\\tGuide: \"\n                + Style.BRIGHT\n                + colored(f\"{self.guideline}\\n\", \"blue\", attrs=[\"underline\"])\n                + Style.RESET_ALL\n            )\n\n        severity_message = f'\\tSeverity: {self.severity.name}\\n' if self.severity else ''\n\n        file_details = colored(\n            \"\\tFile: {}:{}\\n\".format(self.file_path, \"-\".join([str(x) for x in self.file_line_range])), \"magenta\"\n        )\n        code_lines = \"\"\n        if self.code_block:\n            code_lines = \"\\n{}\\n\".format(\"\".join([self._code_line_string(self.code_block, not(ANSI_COLORS_DISABLED))]))\n        caller_file_details = \"\"\n        if self.caller_file_path and self.caller_file_line_range:\n            caller_file_details = colored(\n                \"\\tCalling File: {}:{}\\n\".format(\n                    self.caller_file_path, \"-\".join([str(x) for x in self.caller_file_line_range])\n                ),\n                \"magenta\",\n            )\n        if self.evaluations:\n            for (var_name, var_evaluations) in self.evaluations.items():\n                var_file = var_evaluations[\"var_file\"]\n                var_definitions = var_evaluations[\"definitions\"]\n                for definition_obj in var_definitions:\n                    definition_expression = definition_obj[\"definition_expression\"]\n                    if self._is_expression_in_code_lines(definition_expression):\n                        evaluation_message = evaluation_message + colored(\n                            f'\\tVariable {colored(var_name, \"yellow\")} (of {var_file}) evaluated to value \"{colored(var_evaluations[\"value\"], \"yellow\")}\" '\n                            f'in expression: {colored(definition_obj[\"definition_name\"] + \" = \", \"yellow\")}{colored(definition_obj[\"definition_expression\"], \"yellow\")}\\n',\n                            \"white\",\n                        )\n\n        status_message = colored(\"\\t{} for resource: {}\\n\".format(status, self.resource), status_color)\n        if self.check_result[\"result\"] == CheckResult.FAILED and code_lines and not compact:\n            return f\"{check_message}{status_message}{severity_message}{file_details}{caller_file_details}{guideline_message}{code_lines}{evaluation_message}\"\n\n        if self.check_result[\"result\"] == CheckResult.SKIPPED:\n            return f\"{check_message}{status_message}{severity_message}{suppress_comment}{file_details}{caller_file_details}{guideline_message}\"\n        else:\n            return f\"{check_message}{status_message}{severity_message}{file_details}{caller_file_details}{evaluation_message}{guideline_message}\"\n\n    def __str__(self) -> str:\n        return self.to_string()\n\n    def get_output_id(self, use_bc_ids: bool) -> str:\n        return self.bc_check_id if self.bc_check_id and use_bc_ids else self.check_id\n\n    def get_unique_string(self) -> str:\n        return f\"{self.check_id}.{self.check_result}.{self.file_abs_path}.{self.file_line_range}.{self.resource}\"\n", "path": "checkov/common/output/record.py"}]}