<commit_before>part of dart_amqp.protocol;

class DecodedMessageImpl implements DecodedMessage {
  final int channel;
  final Message message;
  ContentHeader contentHeader;
  ChunkedOutputWriter payloadBuffer;
  Uint8List payload;

  DecodedMessageImpl(this.channel, Message this.message);

  MessageProperties get properties =>
      contentHeader != null ? contentHeader.properties : null;

  set properties(MessageProperties properties) {
    if (contentHeader != null) {
      contentHeader.properties = properties;
    }
  }

  void finalizePayload() {
    if (payloadBuffer != null) {
      payload = payloadBuffer.joinChunks();
      payloadBuffer.clear();
    }
  }

//  String toString() {
//    StringBuffer sb = new StringBuffer("""
//DecodedMessage
//------------
//  channel    : ${channel}
//  message    : ${message.toString().replaceAll(new RegExp("\n"), "\n               ")}
//""");
//
//    if (contentHeader != null) {
//      if (properties != null) {
//        sb.write("  properties : ${properties.toString().replaceAll(new RegExp("\n"), "\n           ")}\n");
//      }
//
//      sb.write("  payload : ${contentHeader.bodySize == 0 ? "N/A" : contentHeader.bodySize}\n");
//    }
//
//    return sb.toString();
//  }

  String get payloadAsString {
    return utf8.decode(payload);
  }

  Map get payloadAsJson {
    return json.decode(utf8.decode(payload));
  }
}
<commit_msg>fix analyzer issues<commit_after>part of dart_amqp.protocol;

class DecodedMessageImpl implements DecodedMessage {
  final int channel;
  final Message message;
  ContentHeader contentHeader;
  ChunkedOutputWriter payloadBuffer;
  Uint8List payload;

  DecodedMessageImpl(this.channel, Message this.message);

  MessageProperties get properties => contentHeader?.properties;

  set properties(MessageProperties properties) {
    if (contentHeader != null) {
      contentHeader.properties = properties;
    }
  }

  void finalizePayload() {
    if (payloadBuffer != null) {
      payload = payloadBuffer.joinChunks();
      payloadBuffer.clear();
    }
  }

//  String toString() {
//    StringBuffer sb = new StringBuffer("""
//DecodedMessage
//------------
//  channel    : ${channel}
//  message    : ${message.toString().replaceAll(new RegExp("\n"), "\n               ")}
//""");
//
//    if (contentHeader != null) {
//      if (properties != null) {
//        sb.write("  properties : ${properties.toString().replaceAll(new RegExp("\n"), "\n           ")}\n");
//      }
//
//      sb.write("  payload : ${contentHeader.bodySize == 0 ? "N/A" : contentHeader.bodySize}\n");
//    }
//
//    return sb.toString();
//  }

  String get payloadAsString {
    return utf8.decode(payload);
  }

  Map get payloadAsJson {
    return json.decode(utf8.decode(payload));
  }
}

{'fraction_non_alphanumeric': 0.15753424657534246, 'fraction_numerical': 0.002883922134102379, 'mean_word_length': 2.7550744248985115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222219', 'n_tokens_mistral': 823, 'n_tokens_neox': 803, 'n_words': 175}