# Global Metrics

path: .metrics.mi.mi_original
old: 74.14520364838705
new: -92.65443075836524
path: .metrics.mi.mi_sei
old: 68.2684293298548
new: -143.63161358900285
path: .metrics.mi.mi_visual_studio
old: 43.359768215431025
new: 0.0
path: .metrics.halstead.N1
old: 51.0
new: 3316.0
path: .metrics.halstead.purity_ratio
old: 1.5721850746866102
new: 1.2483726819924748
path: .metrics.halstead.n2
old: 22.0
new: 700.0
path: .metrics.halstead.effort
old: 5919.425750782534
new: 3582812.9849209385
path: .metrics.halstead.N2
old: 42.0
new: 2176.0
path: .metrics.halstead.vocabulary
old: 35.0
new: 744.0
path: .metrics.halstead.length
old: 93.0
new: 5492.0
path: .metrics.halstead.n1
old: 13.0
new: 44.0
path: .metrics.halstead.time
old: 328.85698615458523
new: 199045.16582894104
path: .metrics.halstead.level
old: 0.08058608058608059
new: 0.014622326203208556
path: .metrics.halstead.volume
old: 477.0233205758819
new: 52389.060190605305
path: .metrics.halstead.estimated_program_length
old: 146.21321194585474
new: 6856.0627695026715
path: .metrics.halstead.bugs
old: 0.1090766514152305
new: 7.804795081834566
path: .metrics.halstead.difficulty
old: 12.409090909090908
new: 68.38857142857142
path: .metrics.cognitive.sum
old: 0.0
new: 225.0
path: .metrics.cognitive.average
old: 0.0
new: 4.5
path: .metrics.nexits.average
old: 0.6666666666666666
new: 2.82
path: .metrics.nexits.sum
old: 2.0
new: 141.0
path: .metrics.cyclomatic.sum
old: 9.0
new: 379.0
path: .metrics.cyclomatic.average
old: 1.2857142857142858
new: 8.23913043478261
path: .metrics.loc.cloc
old: 13.0
new: 226.0
path: .metrics.loc.blank
old: 7.0
new: 195.0
path: .metrics.loc.ploc
old: 28.0
new: 1225.0
path: .metrics.loc.sloc
old: 48.0
new: 1646.0
path: .metrics.loc.lloc
old: 3.0
new: 703.0
path: .metrics.nargs.sum
old: 2.0
new: 73.0
path: .metrics.nargs.average
old: 0.6666666666666666
new: 1.46
path: .metrics.nom.closures
old: 0.0
new: 10.0
path: .metrics.nom.functions
old: 3.0
new: 40.0
path: .metrics.nom.total
old: 3.0
new: 50.0

# Spaces Data

## Minimal test - lines (43, 240)

path: .spaces[0].metrics.cyclomatic.sum
old: 8.0
new: 85.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.3333333333333333
new: 85.0
path: .spaces[0].metrics.cognitive.average
old: 0.0
new: 5.0
path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 5.0
path: .spaces[0].metrics.halstead.N2
old: 38.0
new: 182.0
path: .spaces[0].metrics.halstead.n2
old: 19.0
new: 160.0
path: .spaces[0].metrics.halstead.bugs
old: 0.10741897091485852
new: 0.3669146186689424
path: .spaces[0].metrics.halstead.level
old: 0.07692307692307693
new: 0.10989010989010987
path: .spaces[0].metrics.halstead.vocabulary
old: 32.0
new: 176.0
path: .spaces[0].metrics.halstead.n1
old: 13.0
new: 16.0
path: .spaces[0].metrics.halstead.time
old: 321.3888888888889
new: 2028.8825176958044
path: .spaces[0].metrics.halstead.effort
old: 5785.0
new: 36519.88531852448
path: .spaces[0].metrics.halstead.N1
old: 51.0
new: 356.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 128.8163390912623
new: 1235.508495181978
path: .spaces[0].metrics.halstead.length
old: 89.0
new: 538.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.4473745965310372
new: 2.296484191788063
path: .spaces[0].metrics.halstead.volume
old: 445.0
new: 4013.174210826866
path: .spaces[0].metrics.halstead.difficulty
old: 13.0
new: 9.1
path: .spaces[0].metrics.nexits.average
old: 0.6666666666666666
new: 83.0
path: .spaces[0].metrics.nexits.sum
old: 2.0
new: 83.0
path: .spaces[0].metrics.nargs.average
old: 0.6666666666666666
new: 1.0
path: .spaces[0].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[0].metrics.nom.functions
old: 3.0
new: 1.0
path: .spaces[0].metrics.nom.total
old: 3.0
new: 1.0
path: .spaces[0].metrics.loc.ploc
old: 23.0
new: 176.0
path: .spaces[0].metrics.loc.lloc
old: 3.0
new: 168.0
path: .spaces[0].metrics.loc.blank
old: 4.0
new: 2.0
path: .spaces[0].metrics.loc.sloc
old: 32.0
new: 198.0
path: .spaces[0].metrics.loc.cloc
old: 5.0
new: 20.0
path: .spaces[0].metrics.mi.mi_original
old: 81.30509210737999
new: 22.633917641841748
path: .spaces[0].metrics.mi.mi_visual_studio
old: 47.546837489695896
new: 13.236209147275876
path: .spaces[0].metrics.mi.mi_sei
old: 71.15268048127867
new: -10.756716369890976

### Code

    static uint32_t ConvertAndroidKeyCodeToDOMKeyCode(int32_t androidKeyCode) {
      // Special-case alphanumeric keycodes because they are most common.
      if (androidKeyCode >= AKEYCODE_A && androidKeyCode <= AKEYCODE_Z) {
        return androidKeyCode - AKEYCODE_A + NS_VK_A;
      }

      if (androidKeyCode >= AKEYCODE_0 && androidKeyCode <= AKEYCODE_9) {
        return androidKeyCode - AKEYCODE_0 + NS_VK_0;
      }

      switch (androidKeyCode) {
        // KEYCODE_UNKNOWN (0) ... KEYCODE_HOME (3)
        case AKEYCODE_BACK:
          return NS_VK_ESCAPE;
        // KEYCODE_CALL (5) ... KEYCODE_POUND (18)
        case AKEYCODE_DPAD_UP:
          return NS_VK_UP;
        case AKEYCODE_DPAD_DOWN:
          return NS_VK_DOWN;
        case AKEYCODE_DPAD_LEFT:
          return NS_VK_LEFT;
        case AKEYCODE_DPAD_RIGHT:
          return NS_VK_RIGHT;
        case AKEYCODE_DPAD_CENTER:
          return NS_VK_RETURN;
        case AKEYCODE_VOLUME_UP:
          return NS_VK_VOLUME_UP;
        case AKEYCODE_VOLUME_DOWN:
          return NS_VK_VOLUME_DOWN;
        // KEYCODE_VOLUME_POWER (26) ... KEYCODE_Z (54)
        case AKEYCODE_COMMA:
          return NS_VK_COMMA;
        case AKEYCODE_PERIOD:
          return NS_VK_PERIOD;
        case AKEYCODE_ALT_LEFT:
          return NS_VK_ALT;
        case AKEYCODE_ALT_RIGHT:
          return NS_VK_ALT;
        case AKEYCODE_SHIFT_LEFT:
          return NS_VK_SHIFT;
        case AKEYCODE_SHIFT_RIGHT:
          return NS_VK_SHIFT;
        case AKEYCODE_TAB:
          return NS_VK_TAB;
        case AKEYCODE_SPACE:
          return NS_VK_SPACE;
        // KEYCODE_SYM (63) ... KEYCODE_ENVELOPE (65)
        case AKEYCODE_ENTER:
          return NS_VK_RETURN;
        case AKEYCODE_DEL:
          return NS_VK_BACK;  // Backspace
        case AKEYCODE_GRAVE:
          return NS_VK_BACK_QUOTE;
        // KEYCODE_MINUS (69)
        case AKEYCODE_EQUALS:
          return NS_VK_EQUALS;
        case AKEYCODE_LEFT_BRACKET:
          return NS_VK_OPEN_BRACKET;
        case AKEYCODE_RIGHT_BRACKET:
          return NS_VK_CLOSE_BRACKET;
        case AKEYCODE_BACKSLASH:
          return NS_VK_BACK_SLASH;
        case AKEYCODE_SEMICOLON:
          return NS_VK_SEMICOLON;
        // KEYCODE_APOSTROPHE (75)
        case AKEYCODE_SLASH:
          return NS_VK_SLASH;
        // KEYCODE_AT (77) ... KEYCODE_MEDIA_FAST_FORWARD (90)
        case AKEYCODE_MUTE:
          return NS_VK_VOLUME_MUTE;
        case AKEYCODE_PAGE_UP:
          return NS_VK_PAGE_UP;
        case AKEYCODE_PAGE_DOWN:
          return NS_VK_PAGE_DOWN;
        // KEYCODE_PICTSYMBOLS (94) ... KEYCODE_BUTTON_MODE (110)
        case AKEYCODE_ESCAPE:
          return NS_VK_ESCAPE;
        case AKEYCODE_FORWARD_DEL:
          return NS_VK_DELETE;
        case AKEYCODE_CTRL_LEFT:
          return NS_VK_CONTROL;
        case AKEYCODE_CTRL_RIGHT:
          return NS_VK_CONTROL;
        case AKEYCODE_CAPS_LOCK:
          return NS_VK_CAPS_LOCK;
        case AKEYCODE_SCROLL_LOCK:
          return NS_VK_SCROLL_LOCK;
        // KEYCODE_META_LEFT (117) ... KEYCODE_FUNCTION (119)
        case AKEYCODE_SYSRQ:
          return NS_VK_PRINTSCREEN;
        case AKEYCODE_BREAK:
          return NS_VK_PAUSE;
        case AKEYCODE_MOVE_HOME:
          return NS_VK_HOME;
        case AKEYCODE_MOVE_END:
          return NS_VK_END;
        case AKEYCODE_INSERT:
          return NS_VK_INSERT;
        // KEYCODE_FORWARD (125) ... KEYCODE_MEDIA_RECORD (130)
        case AKEYCODE_F1:
          return NS_VK_F1;
        case AKEYCODE_F2:
          return NS_VK_F2;
        case AKEYCODE_F3:
          return NS_VK_F3;
        case AKEYCODE_F4:
          return NS_VK_F4;
        case AKEYCODE_F5:
          return NS_VK_F5;
        case AKEYCODE_F6:
          return NS_VK_F6;
        case AKEYCODE_F7:
          return NS_VK_F7;
        case AKEYCODE_F8:
          return NS_VK_F8;
        case AKEYCODE_F9:
          return NS_VK_F9;
        case AKEYCODE_F10:
          return NS_VK_F10;
        case AKEYCODE_F11:
          return NS_VK_F11;
        case AKEYCODE_F12:
          return NS_VK_F12;
        case AKEYCODE_NUM_LOCK:
          return NS_VK_NUM_LOCK;
        case AKEYCODE_NUMPAD_0:
          return NS_VK_NUMPAD0;
        case AKEYCODE_NUMPAD_1:
          return NS_VK_NUMPAD1;
        case AKEYCODE_NUMPAD_2:
          return NS_VK_NUMPAD2;
        case AKEYCODE_NUMPAD_3:
          return NS_VK_NUMPAD3;
        case AKEYCODE_NUMPAD_4:
          return NS_VK_NUMPAD4;
        case AKEYCODE_NUMPAD_5:
          return NS_VK_NUMPAD5;
        case AKEYCODE_NUMPAD_6:
          return NS_VK_NUMPAD6;
        case AKEYCODE_NUMPAD_7:
          return NS_VK_NUMPAD7;
        case AKEYCODE_NUMPAD_8:
          return NS_VK_NUMPAD8;
        case AKEYCODE_NUMPAD_9:
          return NS_VK_NUMPAD9;
        case AKEYCODE_NUMPAD_DIVIDE:
          return NS_VK_DIVIDE;
        case AKEYCODE_NUMPAD_MULTIPLY:
          return NS_VK_MULTIPLY;
        case AKEYCODE_NUMPAD_SUBTRACT:
          return NS_VK_SUBTRACT;
        case AKEYCODE_NUMPAD_ADD:
          return NS_VK_ADD;
        case AKEYCODE_NUMPAD_DOT:
          return NS_VK_DECIMAL;
        case AKEYCODE_NUMPAD_COMMA:
          return NS_VK_SEPARATOR;
        case AKEYCODE_NUMPAD_ENTER:
          return NS_VK_RETURN;
        case AKEYCODE_NUMPAD_EQUALS:
          return NS_VK_EQUALS;
        // KEYCODE_NUMPAD_LEFT_PAREN (162) ... KEYCODE_CALCULATOR (210)

        // Needs to confirm the behavior.  If the key switches the open state
        // of Japanese IME (or switches input character between Hiragana and
        // Roman numeric characters), then, it might be better to use
        // NS_VK_KANJI which is used for Alt+Zenkaku/Hankaku key on Windows.
        case AKEYCODE_ZENKAKU_HANKAKU:
          return 0;
        case AKEYCODE_EISU:
          return NS_VK_EISU;
        case AKEYCODE_MUHENKAN:
          return NS_VK_NONCONVERT;
        case AKEYCODE_HENKAN:
          return NS_VK_CONVERT;
        case AKEYCODE_KATAKANA_HIRAGANA:
          return 0;
        case AKEYCODE_YEN:
          return NS_VK_BACK_SLASH;  // Same as other platforms.
        case AKEYCODE_RO:
          return NS_VK_BACK_SLASH;  // Same as other platforms.
        case AKEYCODE_KANA:
          return NS_VK_KANA;
        case AKEYCODE_ASSIST:
          return NS_VK_HELP;

        // the A key is the action key for gamepad devices.
        case AKEYCODE_BUTTON_A:
          return NS_VK_RETURN;

        default:
          ALOG(
              "ConvertAndroidKeyCodeToDOMKeyCode: "
              "No DOM keycode for Android keycode %d",
              int(androidKeyCode));
          return 0;
      }
    }