def new_execution_flag_is_true(self, current_indicator_updated_date, indicator):
        """Check if new execution flag is true. Created a method to reduce cognitive Complexity."""
        __method_name = inspect.currentframe().f_code.co_name
        if self.new_execution_flag == "True":
            if current_indicator_updated_date <= self.current_checkpoint_indicator_date:
                # exit the class. execution is completed.
                return False

            self.sentinel_checkpoint_json_data[
                "next_checkpoint_indicator_date"
            ] = indicator.get("properties", {}).get("lastUpdatedTimeUtc")
            self.sentinel_checkpoint_json_data["new_execution_flag"] = "False"
            try:
                self.sentinel_checkpoint_state.post(
                    json.dumps(self.sentinel_checkpoint_json_data)
                )
            except Exception as error:
                applogger.error(
                    "{}(method={}) : {} Error: {} : "
                    "Error occurred while posting checkpoint data to "
                    "sentinel defender checkpoint state manager.".format(
                        consts.LOGS_STARTS_WITH,
                        __method_name,
                        consts.SENTINEL_TO_DEFENDER,
                        error,
                    )
                )
                raise error
            self.next_checkpoint_indicator_date = (
                self.sentinel_checkpoint_json_data.get("next_checkpoint_indicator_date")
            )
            applogger.debug(
                "{}(method={}) : {}: "
                "Next execution checkpoint date stored : {}".format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    consts.SENTINEL_TO_DEFENDER,
                    self.next_checkpoint_indicator_date,
                )
            )
            self.new_execution_flag = self.sentinel_checkpoint_json_data.get(
                "new_execution_flag"
            )
        return None
Check if new execution flag is true. Created a method to reduce cognitive Complexity.
Solutions/CofenseIntelligence/Data Connectors/CofenseIntelligenceDataConnector/SentinelToDefender/sentinel.py