CHECKSTYLE.OFF: JavadocMethod
512340
protected Map<String, Map<String, Object>> getContexts() {
        Map<String, Map<String, Object>> contexts = new HashMap<>();
        Map<String, Object> deviceMap = new HashMap<>();
        Map<String, Object> osMap     = new HashMap<>();
        Map<String, Object> appMap    = new HashMap<>();
        contexts.put("os",     osMap);
        contexts.put("device", deviceMap);
        contexts.put("app", appMap);

        // Device
        deviceMap.put("manufacturer",          Build.MANUFACTURER);
        deviceMap.put("brand",                 Build.BRAND);
        deviceMap.put("model",                 Build.MODEL);
        deviceMap.put("family",                getFamily());
        deviceMap.put("model_id",              Build.ID);
        deviceMap.put("battery_level",         getBatteryLevel(ctx));
        deviceMap.put("orientation",           getOrientation(ctx));
        deviceMap.put("simulator",             IS_EMULATOR);
        deviceMap.put("arch",                  Build.CPU_ABI);
        deviceMap.put("storage_size",          getTotalInternalStorage());
        deviceMap.put("free_storage",          getUnusedInternalStorage());
        deviceMap.put("external_storage_size", getTotalExternalStorage());
        deviceMap.put("external_free_storage", getUnusedExternalStorage());
        deviceMap.put("charging",              isCharging(ctx));
        deviceMap.put("online",                isConnected(ctx));

        DisplayMetrics displayMetrics = getDisplayMetrics(ctx);
        if (displayMetrics != null) {
            int largestSide   = Math.max(displayMetrics.widthPixels, displayMetrics.heightPixels);
            int smallestSide  = Math.min(displayMetrics.widthPixels, displayMetrics.heightPixels);
            String resolution = Integer.toString(largestSide) + "x" + Integer.toString(smallestSide);
            deviceMap.put("screen_resolution", resolution);
            deviceMap.put("screen_density",    displayMetrics.density);
            deviceMap.put("screen_dpi",        displayMetrics.densityDpi);
        }

        ActivityManager.MemoryInfo memInfo = getMemInfo(ctx);
        if (memInfo != null) {
            deviceMap.put("free_memory", memInfo.availMem);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                deviceMap.put("memory_size", memInfo.totalMem);
            }
            deviceMap.put("low_memory",  memInfo.lowMemory);
        }

        // Operating System
        osMap.put("name",           "Android");
        osMap.put("version",        Build.VERSION.RELEASE);
        osMap.put("build",          Build.DISPLAY);
        osMap.put("kernel_version", KERNEL_VERSION);
        osMap.put("rooted",         isRooted());

        // App
        PackageInfo packageInfo = getPackageInfo(ctx);
        if (packageInfo != null) {
            appMap.put("app_version", packageInfo.versionName);
            appMap.put("app_build", packageInfo.versionCode);
            appMap.put("app_identifier", packageInfo.packageName);
        }

        appMap.put("app_name", getApplicationName(ctx));
        appMap.put("app_start_time", stringifyDate(new Date()));

        return contexts;
    }
768025
public void uncheck() {
        getDispatcher().beforeUncheck(this);
        
        RemoteWebElement e = (RemoteWebElement) getElement();
        while (e.isSelected()) {
            e.click();
        }
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIAction(UIActions.UNCHECKED);
        }
        
        getDispatcher().afterUncheck(this);
    }
1240043
private static void safeFormatTo(Formattable value, StringBuilder out, FormatOptions options) {
    // Only care about 3 specific flags for Formattable.
    int formatFlags = options.getFlags() & (FLAG_LEFT_ALIGN | FLAG_UPPER_CASE | FLAG_SHOW_ALT_FORM);
    if (formatFlags != 0) {
      // TODO: Maybe re-order the options flags to make this step easier or use a lookup table.
      // Note that reordering flags would require a rethink of how they are parsed.
      formatFlags = ((formatFlags & FLAG_LEFT_ALIGN) != 0 ? FormattableFlags.LEFT_JUSTIFY : 0)
          | ((formatFlags & FLAG_UPPER_CASE) != 0 ? FormattableFlags.UPPERCASE : 0)
          | ((formatFlags & FLAG_SHOW_ALT_FORM) != 0 ? FormattableFlags.ALTERNATE : 0);
    }
    // We may need to undo an arbitrary amount of appending if there is an error.
    int originalLength = out.length();
    Formatter formatter = new Formatter(out, FORMAT_LOCALE);
    try {
      value.formatTo(formatter, formatFlags, options.getWidth(), options.getPrecision());
    } catch (RuntimeException e) {
      out.setLength(originalLength);
      // We only use a StringBuilder to create the Formatter instance.
      try {
        formatter.out().append(getErrorString(value, e));
      } catch (IOException impossible) { }
    }
  }
116176
@Nonnull
  private EHTMLElementType _checkHTML ()
  {
    final ICommonsList <String> aTags = new CommonsLinkedList<> ();
    final StringBuilder aSB = new StringBuilder ();
    int nPos = m_nLeading;
    if (m_sValue.charAt (m_nLeading + 1) == '!')
    {
      if (_readXMLComment (this, m_nLeading) > 0)
        return EHTMLElementType.COMMENT;
    }
    nPos = MarkdownHelper.readXMLElement (aSB, m_sValue, m_nLeading, false);
    if (nPos > -1)
    {
      String sElement = aSB.toString ();
      String sTag = MarkdownHelper.getXMLTag (sElement);
      if (!MarkdownHTML.isHtmlBlockElement (sTag))
        return EHTMLElementType.NONE;
      if (EHTMLElement.getFromTagNameOrNull (sTag).mayBeSelfClosed ())
      {
        m_aXmlEndLine = this;
        return EHTMLElementType.TAG;
      }
      aTags.add (sTag);
      Line aLine = this;
      while (aLine != null)
      {
        while (nPos < aLine.m_sValue.length () && aLine.m_sValue.charAt (nPos) != '<')
          nPos++;

        if (nPos >= aLine.m_sValue.length ())
        {
          aLine = aLine.m_aNext;
          nPos = 0;
        }
        else
        {
          aSB.setLength (0);
          final int nNewPos = MarkdownHelper.readXMLElement (aSB, aLine.m_sValue, nPos, false);
          if (nNewPos > 0)
          {
            sElement = aSB.toString ();
            sTag = MarkdownHelper.getXMLTag (sElement);
            if (MarkdownHTML.isHtmlBlockElement (sTag) && !EHTMLElement.getFromTagNameOrNull (sTag).mayBeSelfClosed ())
            {
              if (sElement.charAt (1) == '/')
              {
                if (!aTags.getLast ().equals (sTag))
                  return EHTMLElementType.NONE;
                aTags.removeLast ();
              }
              else
              {
                aTags.add (sTag);
              }
            }
            if (aTags.isEmpty ())
            {
              m_aXmlEndLine = aLine;
              break;
            }
            nPos = nNewPos;
          }
          else
          {
            nPos++;
          }
        }
      }
      if (aTags.isEmpty ())
        return EHTMLElementType.TAG;
    }
    return EHTMLElementType.NONE;
  }
1007483
function checkStylesheet(i) {
  const start = i;
  let l;

  // Check every token:
  while (i < tokensLength) {
    if (l = checkSC(i) ||
        checkRuleset(i) ||
        checkDeclaration(i) ||
        checkDeclDelim(i) ||
        checkAtrule(i) ||
        checkMixin(i)) i += l;
    else throwError(i);
  }

  return i - start;
}
652826
function(e) {
      Event.stopEvent(e);
      this.editorContainer.style.display = 'none';
      this.formattedContainer.style.display = '';
   }
803948
function cleanDoclets(desc) {
  var idx = desc.indexOf('@');
  return (idx === -1 ? desc : desc.substr(0, idx)).trim();
}
615358
function styleCode(editor, sq) {
  if (!sq.hasFormat('PRE') && sq.hasFormat('code')) {
    sq.changeFormat(null, {tag: 'code'});
    removeUnnecessaryCodeInNextToRange(editor.getSelection().cloneRange());
  } else if (!sq.hasFormat('a') && !sq.hasFormat('PRE')) {
    if (sq.hasFormat('b')) {
      sq.removeBold();
    } else if (sq.hasFormat('i')) {
      sq.removeItalic();
    }

    sq.changeFormat({tag: 'code'});

    const range = sq.getSelection().cloneRange();
    range.setStart(range.endContainer, range.endOffset);
    range.collapse(true);

    sq.setSelection(range);
  }
}
944356
protected function __ignoreFromDocBlock()
    {
        $ref = $this->_newReflection();

        // ignored methods from Class DocComment:
        $classDocComment = $ref->getDocComment();
        if ($classDocComment !== false && preg_match_all('/.*[\n]?/', $classDocComment, $lines)) {
            $lines = $lines[0];
            $regex = '/.+(@method).+((?P<method_name>\b\w+)\(.*\))\s@ignore\s/';
            foreach($lines as $line) {
                if (preg_match($regex, $line, $matches))
                    $this->ignore($matches['method_name']);
            }
        }

        // ignored methods from Method DocBlock
        $methods = $ref->getMethods(ReflectionMethod::IS_PUBLIC);
        foreach($methods as $m) {
            $mc = $m->getDocComment();
            if ($mc !== false && preg_match('/@ignore\s/', $mc, $matches))
                $this->ignore($m->getName());
        }
    }
1322997
private void validateReturnJsDoc(Node n, JSDocInfo info) {
    if (!n.isReturn() || info == null) {
      return;
    }
    // @type is handled in validateTypeAnnotations method.
    if (info.containsDeclaration() && !info.hasType()) {
      report(n, JSDOC_ON_RETURN);
    }
  }
282249
private void checkJsdocInfoContainsObjectWithBadKey(Node n) {
    if (n.getJSDocInfo() != null) {
      JSDocInfo info = n.getJSDocInfo();
      checkTypeContainsObjectWithBadKey(n, info.getType());
      checkTypeContainsObjectWithBadKey(n, info.getReturnType());
      checkTypeContainsObjectWithBadKey(n, info.getTypedefType());
      for (String param : info.getParameterNames()) {
        checkTypeContainsObjectWithBadKey(n, info.getParameterType(param));
      }
    }
  }
1174913
function reapplyDisplayStyles() {
    reapplyDisplayStyle(".show-Idl",        e_showIdl.checked)
    reapplyDisplayStyle(".show-JavaScript", e_showJavaScript.checked)
    reapplyDisplayStyle(".show-Java",       e_showJava.checked)
}
413746
@SuppressWarnings({"PMD.UseObjectForClearerAPI"})
    // CHECKSTYLE:ON
    private static void logDefault(final String key,
                                   final String invalidValue,
                                   final String validationError,
                                   final String defaultValue) {

        if (LOG.isWarnEnabled()) {
            final StringBuilder msg = new StringBuilder("Invalid value ('")
                    .append(invalidValue)
                    .append("', ")
                    .append(validationError)
                    .append(") for key '")
                    .append(key)
                    .append("', using default instead ('");
            if (defaultValue == null) {
                msg.append("null')");
            } else {
                msg.append(defaultValue).append("')");
            }
            LOG.warn(msg.toString());
        }
    }
17302
function(type, checks) {
			var handler = checks[0];
			var bglobal = checks[1];
			if (this._remove(type, [handler])) {
				if (bglobal) {
					gui.Tick.removeGlobal(type, handler);
				} else {
					gui.Tick.remove(type, handler, this.$contextid);
				}
			}
		}
114804
@Override
    public synchronized void removeUpdate(DocumentEvent e) {
        int len = e.getLength();
        int off = e.getOffset();
        if (outputMark > off) {
            if (outputMark >= off + len) {
                outputMark -= len;
            } else {
                outputMark = off;
            }
        }
    }
803895
private function checkChecksum(&$content, $id, $realNameId, &$checksumAdded) {
        if ($this->identifiersAi[$realNameId][self::CHECKSUM]) {
            $nbCharContent = strlen($content);
            $minlengthContent = $this->identifiersAi[$realNameId][self::MINLENGTH];
            if ($nbCharContent === ($minlengthContent - 1)) {
                /* we need to calculate the checksum */
                $content .= self::getAiContentChecksum($content);
                $checksumAdded++;
            } elseif ($nbCharContent === $minlengthContent) {
                /* we need to check the checksum */
                $checksum = self::getAiContentChecksum(substr($content, 0, -1));
                if (intval($content[$nbCharContent - 1]) !== $checksum) {
                    throw new CINParseException('gs1128', 'The checksum of "(' . $id . ') ' . $content . '" must be: ' . $checksum);
                }
            }
        }

        return true;
    }
1120764
function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
    var inertBodyElement = null;
    try {
        inertBodyHelper = inertBodyHelper || new InertBodyHelper(defaultDoc);
        // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).
        var unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';
        inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
        // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser
        // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.
        var mXSSAttempts = 5;
        var parsedHtml = unsafeHtml;
        do {
            if (mXSSAttempts === 0) {
                throw new Error('Failed to sanitize html because the input is unstable');
            }
            mXSSAttempts--;
            unsafeHtml = parsedHtml;
            parsedHtml = inertBodyElement.innerHTML;
            inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
        } while (unsafeHtml !== parsedHtml);
        var sanitizer = new SanitizingHtmlSerializer();
        var safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);
        if (isDevMode() && sanitizer.sanitizedSomething) {
            console.warn('WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).');
        }
        return safeHtml;
    }
    finally {
        // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.
        if (inertBodyElement) {
            var parent_1 = getTemplateContent(inertBodyElement) || inertBodyElement;
            while (parent_1.firstChild) {
                parent_1.removeChild(parent_1.firstChild);
            }
        }
    }
}