id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
131,600 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/CollectionUtils.java | CollectionUtils.toArray | public static <A, E extends A> A[] toArray(Enumeration<E> enumeration, A[] array) {
ArrayList<A> elements = new ArrayList<>();
while (enumeration.hasMoreElements()) {
elements.add(enumeration.nextElement());
}
return elements.toArray(array);
} | java | public static <A, E extends A> A[] toArray(Enumeration<E> enumeration, A[] array) {
ArrayList<A> elements = new ArrayList<>();
while (enumeration.hasMoreElements()) {
elements.add(enumeration.nextElement());
}
return elements.toArray(array);
} | [
"public",
"static",
"<",
"A",
",",
"E",
"extends",
"A",
">",
"A",
"[",
"]",
"toArray",
"(",
"Enumeration",
"<",
"E",
">",
"enumeration",
",",
"A",
"[",
"]",
"array",
")",
"{",
"ArrayList",
"<",
"A",
">",
"elements",
"=",
"new",
"ArrayList",
"<>",
... | Marshal the elements from the given enumeration into an array of the given type. Enumeration elements must be
assignable to the type of the given array. The array returned will be a different instance than the array given. | [
"Marshal",
"the",
"elements",
"from",
"the",
"given",
"enumeration",
"into",
"an",
"array",
"of",
"the",
"given",
"type",
".",
"Enumeration",
"elements",
"must",
"be",
"assignable",
"to",
"the",
"type",
"of",
"the",
"given",
"array",
".",
"The",
"array",
"... | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/CollectionUtils.java#L329-L335 |
131,601 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/Server.java | Server.shutdown | public void shutdown() {
if (!isRunning) return;
Executors.getInstance().execute(new Runnable() {
@Override
public void run() {
if (mHttpServer != null) {
mHttpServer.shutdown(3, TimeUnit.MINUTES);
isRunning = false;
... | java | public void shutdown() {
if (!isRunning) return;
Executors.getInstance().execute(new Runnable() {
@Override
public void run() {
if (mHttpServer != null) {
mHttpServer.shutdown(3, TimeUnit.MINUTES);
isRunning = false;
... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"!",
"isRunning",
")",
"return",
";",
"Executors",
".",
"getInstance",
"(",
")",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
... | Quit the server. | [
"Quit",
"the",
"server",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/Server.java#L141-L159 |
131,602 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/util/NetUtils.java | NetUtils.getLocalIPAddress | public static InetAddress getLocalIPAddress() {
Enumeration<NetworkInterface> enumeration = null;
try {
enumeration = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
e.printStackTrace();
}
if (enumeration != null) {
while... | java | public static InetAddress getLocalIPAddress() {
Enumeration<NetworkInterface> enumeration = null;
try {
enumeration = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
e.printStackTrace();
}
if (enumeration != null) {
while... | [
"public",
"static",
"InetAddress",
"getLocalIPAddress",
"(",
")",
"{",
"Enumeration",
"<",
"NetworkInterface",
">",
"enumeration",
"=",
"null",
";",
"try",
"{",
"enumeration",
"=",
"NetworkInterface",
".",
"getNetworkInterfaces",
"(",
")",
";",
"}",
"catch",
"("... | Get local Ip address. | [
"Get",
"local",
"Ip",
"address",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/util/NetUtils.java#L50-L72 |
131,603 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/MainActivity.java | MainActivity.onServerStart | public void onServerStart(String ip) {
closeDialog();
mBtnStart.setVisibility(View.GONE);
mBtnStop.setVisibility(View.VISIBLE);
mBtnBrowser.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(ip)) {
List<String> addressList = new LinkedList<>();
mRootUrl ... | java | public void onServerStart(String ip) {
closeDialog();
mBtnStart.setVisibility(View.GONE);
mBtnStop.setVisibility(View.VISIBLE);
mBtnBrowser.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(ip)) {
List<String> addressList = new LinkedList<>();
mRootUrl ... | [
"public",
"void",
"onServerStart",
"(",
"String",
"ip",
")",
"{",
"closeDialog",
"(",
")",
";",
"mBtnStart",
".",
"setVisibility",
"(",
"View",
".",
"GONE",
")",
";",
"mBtnStop",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"mBtnBrowser",
... | Start notify. | [
"Start",
"notify",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/MainActivity.java#L107-L123 |
131,604 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/MainActivity.java | MainActivity.onServerError | public void onServerError(String message) {
closeDialog();
mRootUrl = null;
mBtnStart.setVisibility(View.VISIBLE);
mBtnStop.setVisibility(View.GONE);
mBtnBrowser.setVisibility(View.GONE);
mTvMessage.setText(message);
} | java | public void onServerError(String message) {
closeDialog();
mRootUrl = null;
mBtnStart.setVisibility(View.VISIBLE);
mBtnStop.setVisibility(View.GONE);
mBtnBrowser.setVisibility(View.GONE);
mTvMessage.setText(message);
} | [
"public",
"void",
"onServerError",
"(",
"String",
"message",
")",
"{",
"closeDialog",
"(",
")",
";",
"mRootUrl",
"=",
"null",
";",
"mBtnStart",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"mBtnStop",
".",
"setVisibility",
"(",
"View",
".",... | Error notify. | [
"Error",
"notify",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/MainActivity.java#L128-L135 |
131,605 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/MainActivity.java | MainActivity.onServerStop | public void onServerStop() {
closeDialog();
mRootUrl = null;
mBtnStart.setVisibility(View.VISIBLE);
mBtnStop.setVisibility(View.GONE);
mBtnBrowser.setVisibility(View.GONE);
mTvMessage.setText(R.string.server_stop_succeed);
} | java | public void onServerStop() {
closeDialog();
mRootUrl = null;
mBtnStart.setVisibility(View.VISIBLE);
mBtnStop.setVisibility(View.GONE);
mBtnBrowser.setVisibility(View.GONE);
mTvMessage.setText(R.string.server_stop_succeed);
} | [
"public",
"void",
"onServerStop",
"(",
")",
"{",
"closeDialog",
"(",
")",
";",
"mRootUrl",
"=",
"null",
";",
"mBtnStart",
".",
"setVisibility",
"(",
"View",
".",
"VISIBLE",
")",
";",
"mBtnStop",
".",
"setVisibility",
"(",
"View",
".",
"GONE",
")",
";",
... | Stop notify. | [
"Stop",
"notify",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/MainActivity.java#L140-L147 |
131,606 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java | StandardMultipartResolver.setUploadTempDir | public void setUploadTempDir(File uploadTempDir) throws IOException {
if (!uploadTempDir.exists() && !uploadTempDir.mkdirs()) {
String message = "Given uploadTempDir [" + uploadTempDir + "] could not be created.";
throw new IllegalArgumentException(message);
}
this.mFileI... | java | public void setUploadTempDir(File uploadTempDir) throws IOException {
if (!uploadTempDir.exists() && !uploadTempDir.mkdirs()) {
String message = "Given uploadTempDir [" + uploadTempDir + "] could not be created.";
throw new IllegalArgumentException(message);
}
this.mFileI... | [
"public",
"void",
"setUploadTempDir",
"(",
"File",
"uploadTempDir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"uploadTempDir",
".",
"exists",
"(",
")",
"&&",
"!",
"uploadTempDir",
".",
"mkdirs",
"(",
")",
")",
"{",
"String",
"message",
"=",
"\"Giv... | Set the temporary directory where uploaded files get stored. | [
"Set",
"the",
"temporary",
"directory",
"where",
"uploaded",
"files",
"get",
"stored",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java#L99-L105 |
131,607 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java | StandardMultipartResolver.parseRequest | private MultipartParsingResult parseRequest(HttpRequest request) throws MultipartException {
String encoding = determineEncoding(request);
FileUpload fileUpload = prepareFileUpload(encoding);
try {
RequestBody body = request.getBody();
Assert.notNull(body, "The body canno... | java | private MultipartParsingResult parseRequest(HttpRequest request) throws MultipartException {
String encoding = determineEncoding(request);
FileUpload fileUpload = prepareFileUpload(encoding);
try {
RequestBody body = request.getBody();
Assert.notNull(body, "The body canno... | [
"private",
"MultipartParsingResult",
"parseRequest",
"(",
"HttpRequest",
"request",
")",
"throws",
"MultipartException",
"{",
"String",
"encoding",
"=",
"determineEncoding",
"(",
"request",
")",
";",
"FileUpload",
"fileUpload",
"=",
"prepareFileUpload",
"(",
"encoding",... | Parse the given request, resolving its multipart elements.
@param request the request to parse.
@return the parsing result.
@throws MultipartException if multipart resolution failed. | [
"Parse",
"the",
"given",
"request",
"resolving",
"its",
"multipart",
"elements",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java#L152-L167 |
131,608 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java | StandardMultipartResolver.determineEncoding | @NonNull
private String determineEncoding(HttpRequest request) {
MediaType mimeType = request.getContentType();
if (mimeType == null) return Charsets.UTF_8.name();
Charset charset = mimeType.getCharset();
return charset == null ? Charsets.UTF_8.name() : charset.name();
} | java | @NonNull
private String determineEncoding(HttpRequest request) {
MediaType mimeType = request.getContentType();
if (mimeType == null) return Charsets.UTF_8.name();
Charset charset = mimeType.getCharset();
return charset == null ? Charsets.UTF_8.name() : charset.name();
} | [
"@",
"NonNull",
"private",
"String",
"determineEncoding",
"(",
"HttpRequest",
"request",
")",
"{",
"MediaType",
"mimeType",
"=",
"request",
".",
"getContentType",
"(",
")",
";",
"if",
"(",
"mimeType",
"==",
"null",
")",
"return",
"Charsets",
".",
"UTF_8",
".... | Determine the encoding for the given request.
<p>The default implementation checks the request encoding, falling back to the default encoding specified for
this resolver.
@param request current request
@return the encoding for the request . | [
"Determine",
"the",
"encoding",
"for",
"the",
"given",
"request",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java#L179-L185 |
131,609 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java | StandardMultipartResolver.parseFileItems | protected MultipartParsingResult parseFileItems(List<FileItem> fileItems, String encoding) {
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<>();
MultiValueMap<String, String> multipartParameters = new LinkedMultiValueMap<>();
Map<String, String> multipartContentTyp... | java | protected MultipartParsingResult parseFileItems(List<FileItem> fileItems, String encoding) {
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<>();
MultiValueMap<String, String> multipartParameters = new LinkedMultiValueMap<>();
Map<String, String> multipartContentTyp... | [
"protected",
"MultipartParsingResult",
"parseFileItems",
"(",
"List",
"<",
"FileItem",
">",
"fileItems",
",",
"String",
"encoding",
")",
"{",
"MultiValueMap",
"<",
"String",
",",
"MultipartFile",
">",
"multipartFiles",
"=",
"new",
"LinkedMultiValueMap",
"<>",
"(",
... | Parse the given List of Commons FileItems into a MultipartParsingResult, containing MultipartFile instances and a
Map of multipart parameter.
@param fileItems the Commons FileItems to parse.
@param encoding the encoding to use for form fields.
@return the MultipartParsingResult.
@see StandardMultipartFile#StandardMu... | [
"Parse",
"the",
"given",
"List",
"of",
"Commons",
"FileItems",
"into",
"a",
"MultipartParsingResult",
"containing",
"MultipartFile",
"instances",
"and",
"a",
"Map",
"of",
"multipart",
"parameter",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java#L219-L255 |
131,610 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/CoreService.java | CoreService.startServer | private void startServer() {
if (mServer.isRunning()) {
String hostAddress = mServer.getInetAddress().getHostAddress();
ServerManager.onServerStart(CoreService.this, hostAddress);
} else {
mServer.startup();
}
} | java | private void startServer() {
if (mServer.isRunning()) {
String hostAddress = mServer.getInetAddress().getHostAddress();
ServerManager.onServerStart(CoreService.this, hostAddress);
} else {
mServer.startup();
}
} | [
"private",
"void",
"startServer",
"(",
")",
"{",
"if",
"(",
"mServer",
".",
"isRunning",
"(",
")",
")",
"{",
"String",
"hostAddress",
"=",
"mServer",
".",
"getInetAddress",
"(",
")",
".",
"getHostAddress",
"(",
")",
";",
"ServerManager",
".",
"onServerStar... | Start server. | [
"Start",
"server",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/CoreService.java#L77-L84 |
131,611 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java | JsonUtils.successfulJson | public static String successfulJson(Object data) {
ReturnData returnData = new ReturnData();
returnData.setSuccess(true);
returnData.setErrorCode(200);
returnData.setData(data);
return JSON.toJSONString(returnData);
} | java | public static String successfulJson(Object data) {
ReturnData returnData = new ReturnData();
returnData.setSuccess(true);
returnData.setErrorCode(200);
returnData.setData(data);
return JSON.toJSONString(returnData);
} | [
"public",
"static",
"String",
"successfulJson",
"(",
"Object",
"data",
")",
"{",
"ReturnData",
"returnData",
"=",
"new",
"ReturnData",
"(",
")",
";",
"returnData",
".",
"setSuccess",
"(",
"true",
")",
";",
"returnData",
".",
"setErrorCode",
"(",
"200",
")",
... | Business is successful.
@param data return data.
@return json. | [
"Business",
"is",
"successful",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java#L35-L41 |
131,612 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java | JsonUtils.failedJson | public static String failedJson(int code, String message) {
ReturnData returnData = new ReturnData();
returnData.setSuccess(false);
returnData.setErrorCode(code);
returnData.setErrorMsg(message);
return JSON.toJSONString(returnData);
} | java | public static String failedJson(int code, String message) {
ReturnData returnData = new ReturnData();
returnData.setSuccess(false);
returnData.setErrorCode(code);
returnData.setErrorMsg(message);
return JSON.toJSONString(returnData);
} | [
"public",
"static",
"String",
"failedJson",
"(",
"int",
"code",
",",
"String",
"message",
")",
"{",
"ReturnData",
"returnData",
"=",
"new",
"ReturnData",
"(",
")",
";",
"returnData",
".",
"setSuccess",
"(",
"false",
")",
";",
"returnData",
".",
"setErrorCode... | Business is failed.
@param code error code.
@param message message.
@return json. | [
"Business",
"is",
"failed",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java#L51-L57 |
131,613 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java | JsonUtils.parseJson | public static <T> T parseJson(String json, Type type) {
return JSON.parseObject(json, type);
} | java | public static <T> T parseJson(String json, Type type) {
return JSON.parseObject(json, type);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"parseJson",
"(",
"String",
"json",
",",
"Type",
"type",
")",
"{",
"return",
"JSON",
".",
"parseObject",
"(",
"json",
",",
"type",
")",
";",
"}"
] | Parse json to object.
@param json json string.
@param type the type of object.
@param <T> type.
@return object. | [
"Parse",
"json",
"to",
"object",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/util/JsonUtils.java#L79-L81 |
131,614 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartFile.java | StandardMultipartFile.isAvailable | protected boolean isAvailable() {
// If in memory, it's available.
if (fileItem.isInMemory()) {
return true;
}
// Check actual existence of temporary file.
if (fileItem instanceof DiskFileItem) {
return ((DiskFileItem)fileItem).getStoreLocation().exists();... | java | protected boolean isAvailable() {
// If in memory, it's available.
if (fileItem.isInMemory()) {
return true;
}
// Check actual existence of temporary file.
if (fileItem instanceof DiskFileItem) {
return ((DiskFileItem)fileItem).getStoreLocation().exists();... | [
"protected",
"boolean",
"isAvailable",
"(",
")",
"{",
"// If in memory, it's available.",
"if",
"(",
"fileItem",
".",
"isInMemory",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"// Check actual existence of temporary file.",
"if",
"(",
"fileItem",
"instanceof",
"... | Determine whether the multipart content is still available. If a temporary file has been moved, the content is no
longer available. | [
"Determine",
"whether",
"the",
"multipart",
"content",
"is",
"still",
"available",
".",
"If",
"a",
"temporary",
"file",
"has",
"been",
"moved",
"the",
"content",
"is",
"no",
"longer",
"available",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartFile.java#L160-L171 |
131,615 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/framework/handler/MappingAdapter.java | MappingAdapter.getMappings | @NonNull
private List<Mapping> getMappings(String httpPath) {
List<Mapping> returned = new ArrayList<>();
List<Path.Segment> httpSegments = Path.pathToList(httpPath);
Map<Mapping, RequestHandler> mappings = getMappingMap();
for (Mapping mapping : mappings.keySet()) {
List... | java | @NonNull
private List<Mapping> getMappings(String httpPath) {
List<Mapping> returned = new ArrayList<>();
List<Path.Segment> httpSegments = Path.pathToList(httpPath);
Map<Mapping, RequestHandler> mappings = getMappingMap();
for (Mapping mapping : mappings.keySet()) {
List... | [
"@",
"NonNull",
"private",
"List",
"<",
"Mapping",
">",
"getMappings",
"(",
"String",
"httpPath",
")",
"{",
"List",
"<",
"Mapping",
">",
"returned",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"Path",
".",
"Segment",
">",
"httpSegments",
... | Get the mapping corresponding to the path.
@param httpPath http path.
@return a {@link Mapping} object, or {@code null} if the path is not mapped. | [
"Get",
"the",
"mapping",
"corresponding",
"to",
"the",
"path",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/framework/handler/MappingAdapter.java#L101-L130 |
131,616 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/util/FileUtils.java | FileUtils.createRandomFile | public static File createRandomFile(MultipartFile file) {
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(file.getContentType().toString());
if (StringUtils.isEmpty(extension)) {
extension = MimeTypeMap.getFileExtensionFromUrl(file.getFilename());
}
Str... | java | public static File createRandomFile(MultipartFile file) {
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(file.getContentType().toString());
if (StringUtils.isEmpty(extension)) {
extension = MimeTypeMap.getFileExtensionFromUrl(file.getFilename());
}
Str... | [
"public",
"static",
"File",
"createRandomFile",
"(",
"MultipartFile",
"file",
")",
"{",
"String",
"extension",
"=",
"MimeTypeMap",
".",
"getSingleton",
"(",
")",
".",
"getExtensionFromMimeType",
"(",
"file",
".",
"getContentType",
"(",
")",
".",
"toString",
"(",... | Create a random file based on mimeType.
@param file file.
@return file object. | [
"Create",
"a",
"random",
"file",
"based",
"on",
"mimeType",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/util/FileUtils.java#L40-L47 |
131,617 | yanzhenjie/AndServer | sample/src/main/java/com/yanzhenjie/andserver/sample/util/FileUtils.java | FileUtils.storageAvailable | public static boolean storageAvailable() {
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
File sd = new File(Environment.getExternalStorageDirectory().getAbsolutePath());
return sd.canWrite();
} else {
return false;
}
} | java | public static boolean storageAvailable() {
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
File sd = new File(Environment.getExternalStorageDirectory().getAbsolutePath());
return sd.canWrite();
} else {
return false;
}
} | [
"public",
"static",
"boolean",
"storageAvailable",
"(",
")",
"{",
"if",
"(",
"Environment",
".",
"getExternalStorageState",
"(",
")",
".",
"equals",
"(",
"Environment",
".",
"MEDIA_MOUNTED",
")",
")",
"{",
"File",
"sd",
"=",
"new",
"File",
"(",
"Environment"... | SD is available.
@return true, otherwise is false. | [
"SD",
"is",
"available",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/sample/src/main/java/com/yanzhenjie/andserver/sample/util/FileUtils.java#L54-L61 |
131,618 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/MediaType.java | MediaType.getUrlExtension | public static String getUrlExtension(String url) {
String extension = MimeTypeMap.getFileExtensionFromUrl(url);
return TextUtils.isEmpty(extension) ? "" : extension;
} | java | public static String getUrlExtension(String url) {
String extension = MimeTypeMap.getFileExtensionFromUrl(url);
return TextUtils.isEmpty(extension) ? "" : extension;
} | [
"public",
"static",
"String",
"getUrlExtension",
"(",
"String",
"url",
")",
"{",
"String",
"extension",
"=",
"MimeTypeMap",
".",
"getFileExtensionFromUrl",
"(",
"url",
")",
";",
"return",
"TextUtils",
".",
"isEmpty",
"(",
"extension",
")",
"?",
"\"\"",
":",
... | Get he extension by url.
@param url url.
@return extension name. | [
"Get",
"he",
"extension",
"by",
"url",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/MediaType.java#L613-L616 |
131,619 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/Executors.java | Executors.getInstance | public static Executors getInstance() {
if (instance == null) {
synchronized (Executors.class) {
if (instance == null) instance = new Executors();
}
}
return instance;
} | java | public static Executors getInstance() {
if (instance == null) {
synchronized (Executors.class) {
if (instance == null) instance = new Executors();
}
}
return instance;
} | [
"public",
"static",
"Executors",
"getInstance",
"(",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"synchronized",
"(",
"Executors",
".",
"class",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"instance",
"=",
"new",
"Executors",
"(",
... | Get instance.
@return {@link Executors}. | [
"Get",
"instance",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/Executors.java#L37-L44 |
131,620 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/Executors.java | Executors.submit | public <T> Future<T> submit(Runnable runnable, T result) {
return mService.submit(runnable, result);
} | java | public <T> Future<T> submit(Runnable runnable, T result) {
return mService.submit(runnable, result);
} | [
"public",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"submit",
"(",
"Runnable",
"runnable",
",",
"T",
"result",
")",
"{",
"return",
"mService",
".",
"submit",
"(",
"runnable",
",",
"result",
")",
";",
"}"
] | Submit a runnable. | [
"Submit",
"a",
"runnable",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/Executors.java#L78-L80 |
131,621 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/Executors.java | Executors.submit | public <T> Future<T> submit(Callable<T> callable) {
return mService.submit(callable);
} | java | public <T> Future<T> submit(Callable<T> callable) {
return mService.submit(callable);
} | [
"public",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"submit",
"(",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"return",
"mService",
".",
"submit",
"(",
"callable",
")",
";",
"}"
] | Submit a callable. | [
"Submit",
"a",
"callable",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/Executors.java#L85-L87 |
131,622 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/DispatcherHandler.java | DispatcherHandler.preHandle | private boolean preHandle(HttpRequest request, HttpResponse response, RequestHandler handler) throws Exception {
for (HandlerInterceptor interceptor : mInterceptorList) {
if (interceptor.onIntercept(request, response, handler)) return true;
}
return false;
} | java | private boolean preHandle(HttpRequest request, HttpResponse response, RequestHandler handler) throws Exception {
for (HandlerInterceptor interceptor : mInterceptorList) {
if (interceptor.onIntercept(request, response, handler)) return true;
}
return false;
} | [
"private",
"boolean",
"preHandle",
"(",
"HttpRequest",
"request",
",",
"HttpResponse",
"response",
",",
"RequestHandler",
"handler",
")",
"throws",
"Exception",
"{",
"for",
"(",
"HandlerInterceptor",
"interceptor",
":",
"mInterceptorList",
")",
"{",
"if",
"(",
"in... | Intercept the execution of a handler.
@param request current request.
@param response current response.
@param handler the corresponding handler of the current request.
@return true if the interceptor has processed the request and responded. | [
"Intercept",
"the",
"execution",
"of",
"a",
"handler",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/DispatcherHandler.java#L182-L187 |
131,623 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/MimeType.java | MimeType.getCharset | public Charset getCharset() {
String charset = getParameter(PARAM_CHARSET);
return (charset != null ? Charset.forName(unquote(charset)) : null);
} | java | public Charset getCharset() {
String charset = getParameter(PARAM_CHARSET);
return (charset != null ? Charset.forName(unquote(charset)) : null);
} | [
"public",
"Charset",
"getCharset",
"(",
")",
"{",
"String",
"charset",
"=",
"getParameter",
"(",
"PARAM_CHARSET",
")",
";",
"return",
"(",
"charset",
"!=",
"null",
"?",
"Charset",
".",
"forName",
"(",
"unquote",
"(",
"charset",
")",
")",
":",
"null",
")"... | Return the character set, as indicated by a charset parameter, if any.
@return the character set, or null if not available. | [
"Return",
"the",
"character",
"set",
"as",
"indicated",
"by",
"a",
"charset",
"parameter",
"if",
"any",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/MimeType.java#L267-L270 |
131,624 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/framework/website/AssetsWebsite.java | AssetsWebsite.tryScanFile | private void tryScanFile() {
if (!isScanned) {
synchronized (AssetsWebsite.class) {
if (!isScanned) {
List<String> fileList = mReader.scanFile(mRootPath);
for (String filePath : fileList) {
String httpPath = filePath.sub... | java | private void tryScanFile() {
if (!isScanned) {
synchronized (AssetsWebsite.class) {
if (!isScanned) {
List<String> fileList = mReader.scanFile(mRootPath);
for (String filePath : fileList) {
String httpPath = filePath.sub... | [
"private",
"void",
"tryScanFile",
"(",
")",
"{",
"if",
"(",
"!",
"isScanned",
")",
"{",
"synchronized",
"(",
"AssetsWebsite",
".",
"class",
")",
"{",
"if",
"(",
"!",
"isScanned",
")",
"{",
"List",
"<",
"String",
">",
"fileList",
"=",
"mReader",
".",
... | Try to scan the file, no longer scan if it has already been scanned. | [
"Try",
"to",
"scan",
"the",
"file",
"no",
"longer",
"scan",
"if",
"it",
"has",
"already",
"been",
"scanned",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/framework/website/AssetsWebsite.java#L105-L127 |
131,625 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/cookie/Cookie.java | Cookie.isToken | private boolean isToken(String value) {
int len = value.length();
for (int i = 0; i < len; i++) {
char c = value.charAt(i);
if (c < 0x20 || c >= 0x7f || TSPECIALS.indexOf(c) != -1) {
return false;
}
}
return true;
} | java | private boolean isToken(String value) {
int len = value.length();
for (int i = 0; i < len; i++) {
char c = value.charAt(i);
if (c < 0x20 || c >= 0x7f || TSPECIALS.indexOf(c) != -1) {
return false;
}
}
return true;
} | [
"private",
"boolean",
"isToken",
"(",
"String",
"value",
")",
"{",
"int",
"len",
"=",
"value",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"char",
"c",
"=",
"value",
".",
"ch... | Tests a string and returns true if the string counts as a reserved token in the Java language.
@param value the {@code String} to be tested.
@return {@code true} if the {@code String} is a reserved token; {@code false} otherwise. | [
"Tests",
"a",
"string",
"and",
"returns",
"true",
"if",
"the",
"string",
"counts",
"as",
"a",
"reserved",
"token",
"in",
"the",
"Java",
"language",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/cookie/Cookie.java#L297-L307 |
131,626 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/HttpDateFormat.java | HttpDateFormat.getCurrentDate | public static String getCurrentDate() {
synchronized (FORMAT) {
long now = System.currentTimeMillis();
return FORMAT.format(new Date(now));
}
} | java | public static String getCurrentDate() {
synchronized (FORMAT) {
long now = System.currentTimeMillis();
return FORMAT.format(new Date(now));
}
} | [
"public",
"static",
"String",
"getCurrentDate",
"(",
")",
"{",
"synchronized",
"(",
"FORMAT",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"return",
"FORMAT",
".",
"format",
"(",
"new",
"Date",
"(",
"now",
")",
")",
... | Get the current date in HTTP format.
@return the HTTP date. | [
"Get",
"the",
"current",
"date",
"in",
"HTTP",
"format",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/HttpDateFormat.java#L52-L57 |
131,627 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/HttpDateFormat.java | HttpDateFormat.formatDate | public static String formatDate(long value) {
synchronized (HttpDateFormat.class) {
Date dateValue = new Date(value);
return FORMAT.format(dateValue);
}
} | java | public static String formatDate(long value) {
synchronized (HttpDateFormat.class) {
Date dateValue = new Date(value);
return FORMAT.format(dateValue);
}
} | [
"public",
"static",
"String",
"formatDate",
"(",
"long",
"value",
")",
"{",
"synchronized",
"(",
"HttpDateFormat",
".",
"class",
")",
"{",
"Date",
"dateValue",
"=",
"new",
"Date",
"(",
"value",
")",
";",
"return",
"FORMAT",
".",
"format",
"(",
"dateValue",... | Get the HTTP format of the specified date.
@param value the date.
@return the HTTP date. | [
"Get",
"the",
"HTTP",
"format",
"of",
"the",
"specified",
"date",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/HttpDateFormat.java#L66-L71 |
131,628 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/HttpDateFormat.java | HttpDateFormat.parseDate | public static long parseDate(String value) {
Date date = null;
for (SimpleDateFormat format : FORMATS_TEMPLATE) {
try {
date = format.parse(value);
} catch (ParseException e) {
// Nothing.
}
}
if (date == null) return -... | java | public static long parseDate(String value) {
Date date = null;
for (SimpleDateFormat format : FORMATS_TEMPLATE) {
try {
date = format.parse(value);
} catch (ParseException e) {
// Nothing.
}
}
if (date == null) return -... | [
"public",
"static",
"long",
"parseDate",
"(",
"String",
"value",
")",
"{",
"Date",
"date",
"=",
"null",
";",
"for",
"(",
"SimpleDateFormat",
"format",
":",
"FORMATS_TEMPLATE",
")",
"{",
"try",
"{",
"date",
"=",
"format",
".",
"parse",
"(",
"value",
")",
... | Try to parse the given date as a HTTP date.
@param value the HTTP date.
@return the date as a long. | [
"Try",
"to",
"parse",
"the",
"given",
"date",
"as",
"a",
"HTTP",
"date",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/HttpDateFormat.java#L80-L92 |
131,629 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/util/comparator/CompoundComparator.java | CompoundComparator.setComparator | public void setComparator(int index, Comparator<T> comparator, boolean ascending) {
this.comparators.set(index, new InvertibleComparator<>(comparator, ascending));
} | java | public void setComparator(int index, Comparator<T> comparator, boolean ascending) {
this.comparators.set(index, new InvertibleComparator<>(comparator, ascending));
} | [
"public",
"void",
"setComparator",
"(",
"int",
"index",
",",
"Comparator",
"<",
"T",
">",
"comparator",
",",
"boolean",
"ascending",
")",
"{",
"this",
".",
"comparators",
".",
"set",
"(",
"index",
",",
"new",
"InvertibleComparator",
"<>",
"(",
"comparator",
... | Replace the Comparator at the given index using the given sort order.
@param index the index of the Comparator to replace
@param comparator the Comparator to place at the given index
@param ascending the sort order: ascending (true) or descending (false) | [
"Replace",
"the",
"Comparator",
"at",
"the",
"given",
"index",
"using",
"the",
"given",
"sort",
"order",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/util/comparator/CompoundComparator.java#L112-L114 |
131,630 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/ComponentRegister.java | ComponentRegister.getDexFilePaths | public static List<String> getDexFilePaths(Context context) {
ApplicationInfo appInfo = context.getApplicationInfo();
File sourceApk = new File(appInfo.sourceDir);
List<String> sourcePaths = new ArrayList<>();
sourcePaths.add(appInfo.sourceDir);
if (!isVMMultidexCapable()) {
... | java | public static List<String> getDexFilePaths(Context context) {
ApplicationInfo appInfo = context.getApplicationInfo();
File sourceApk = new File(appInfo.sourceDir);
List<String> sourcePaths = new ArrayList<>();
sourcePaths.add(appInfo.sourceDir);
if (!isVMMultidexCapable()) {
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getDexFilePaths",
"(",
"Context",
"context",
")",
"{",
"ApplicationInfo",
"appInfo",
"=",
"context",
".",
"getApplicationInfo",
"(",
")",
";",
"File",
"sourceApk",
"=",
"new",
"File",
"(",
"appInfo",
".",
"sou... | Obtain all the dex path.
@see com.android.support.MultiDex#loadExistingExtractions(Context, String)
@see com.android.support.MultiDex#clearOldDexDir(Context) | [
"Obtain",
"all",
"the",
"dex",
"path",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/ComponentRegister.java#L123-L148 |
131,631 | yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/ComponentRegister.java | ComponentRegister.isVMMultidexCapable | private static boolean isVMMultidexCapable() {
boolean isMultidexCapable = false;
String vmVersion = System.getProperty("java.vm.version");
try {
Matcher matcher = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?").matcher(vmVersion);
if (matcher.matches()) {
in... | java | private static boolean isVMMultidexCapable() {
boolean isMultidexCapable = false;
String vmVersion = System.getProperty("java.vm.version");
try {
Matcher matcher = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?").matcher(vmVersion);
if (matcher.matches()) {
in... | [
"private",
"static",
"boolean",
"isVMMultidexCapable",
"(",
")",
"{",
"boolean",
"isMultidexCapable",
"=",
"false",
";",
"String",
"vmVersion",
"=",
"System",
".",
"getProperty",
"(",
"\"java.vm.version\"",
")",
";",
"try",
"{",
"Matcher",
"matcher",
"=",
"Patte... | Identifies if the current VM has a native support for multidex.
@return true, otherwise is false.
@see android.support.multidex.MultiDexExtractor#isVMMultidexCapable(String) | [
"Identifies",
"if",
"the",
"current",
"VM",
"has",
"a",
"native",
"support",
"for",
"multidex",
"."
] | f95f316cdfa5755d6a3fec3c6a1b5df783b81517 | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/ComponentRegister.java#L157-L172 |
131,632 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/BusCompOwnerServiceImpl.java | BusCompOwnerServiceImpl.getBusinessServiceList | private List<String> getBusinessServiceList(String firstName, String lastName){
List<String> businessServiceList = new ArrayList<>();
List<Cmdb> cmdbs = cmdbService.getAllBusServices();
/**
Defining search parameters
*/
Predicate<Cmdb> supportOwnerLn = p -> p.getSuppor... | java | private List<String> getBusinessServiceList(String firstName, String lastName){
List<String> businessServiceList = new ArrayList<>();
List<Cmdb> cmdbs = cmdbService.getAllBusServices();
/**
Defining search parameters
*/
Predicate<Cmdb> supportOwnerLn = p -> p.getSuppor... | [
"private",
"List",
"<",
"String",
">",
"getBusinessServiceList",
"(",
"String",
"firstName",
",",
"String",
"lastName",
")",
"{",
"List",
"<",
"String",
">",
"businessServiceList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"Cmdb",
">",
"cm... | Takes First name and last name and returns any Business Services where one of the 4 owner fields match the input
@param firstName
@param lastName
@return returns business service ObjectId list | [
"Takes",
"First",
"name",
"and",
"last",
"name",
"and",
"returns",
"any",
"Business",
"Services",
"where",
"one",
"of",
"the",
"4",
"owner",
"fields",
"match",
"the",
"input"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/BusCompOwnerServiceImpl.java#L89-L125 |
131,633 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/BusCompOwnerServiceImpl.java | BusCompOwnerServiceImpl.doesMatchFullName | private boolean doesMatchFullName(String firstName, String fullName){
boolean matching = false;
if(firstName != null && !firstName.isEmpty() && fullName != null && !fullName.isEmpty()){
String firstFromCMDB;
String[] array = fullName.split(" ");
firstName = firstName... | java | private boolean doesMatchFullName(String firstName, String fullName){
boolean matching = false;
if(firstName != null && !firstName.isEmpty() && fullName != null && !fullName.isEmpty()){
String firstFromCMDB;
String[] array = fullName.split(" ");
firstName = firstName... | [
"private",
"boolean",
"doesMatchFullName",
"(",
"String",
"firstName",
",",
"String",
"fullName",
")",
"{",
"boolean",
"matching",
"=",
"false",
";",
"if",
"(",
"firstName",
"!=",
"null",
"&&",
"!",
"firstName",
".",
"isEmpty",
"(",
")",
"&&",
"fullName",
... | Takes first name and full name and returns true or false if first name is found in full name
@param firstName
@param fullName
@return true or false if match found | [
"Takes",
"first",
"name",
"and",
"full",
"name",
"and",
"returns",
"true",
"or",
"false",
"if",
"first",
"name",
"is",
"found",
"in",
"full",
"name"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/BusCompOwnerServiceImpl.java#L134-L152 |
131,634 | Hygieia/Hygieia | collectors/library-policy/nexus-iq-collector/src/main/java/com/capitalone/dashboard/collector/DefaultNexusIQClient.java | DefaultNexusIQClient.getApplications | @Override
public List<NexusIQApplication> getApplications(String instanceUrl) {
List<NexusIQApplication> nexusIQApplications = new ArrayList<>();
String url = instanceUrl + API_V2_APPLICATIONS;
try {
JSONObject jsonObject = parseAsObject(url);
JSONArray jsonArray = (... | java | @Override
public List<NexusIQApplication> getApplications(String instanceUrl) {
List<NexusIQApplication> nexusIQApplications = new ArrayList<>();
String url = instanceUrl + API_V2_APPLICATIONS;
try {
JSONObject jsonObject = parseAsObject(url);
JSONArray jsonArray = (... | [
"@",
"Override",
"public",
"List",
"<",
"NexusIQApplication",
">",
"getApplications",
"(",
"String",
"instanceUrl",
")",
"{",
"List",
"<",
"NexusIQApplication",
">",
"nexusIQApplications",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",
"url",
"=",
"in... | Get all the applications from the nexus IQ server
@param instanceUrl instance of nexus iq
@return List of applications | [
"Get",
"all",
"the",
"applications",
"from",
"the",
"nexus",
"IQ",
"server"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/library-policy/nexus-iq-collector/src/main/java/com/capitalone/dashboard/collector/DefaultNexusIQClient.java#L67-L91 |
131,635 | Hygieia/Hygieia | collectors/library-policy/nexus-iq-collector/src/main/java/com/capitalone/dashboard/collector/DefaultNexusIQClient.java | DefaultNexusIQClient.getApplicationReport | @Override
public List<LibraryPolicyReport> getApplicationReport(NexusIQApplication application) {
List<LibraryPolicyReport> applicationReports = new ArrayList<>();
String appReportLinkUrl = String.format(
application.getInstanceUrl() + API_V2_REPORTS_LINKS, application.getApplicatio... | java | @Override
public List<LibraryPolicyReport> getApplicationReport(NexusIQApplication application) {
List<LibraryPolicyReport> applicationReports = new ArrayList<>();
String appReportLinkUrl = String.format(
application.getInstanceUrl() + API_V2_REPORTS_LINKS, application.getApplicatio... | [
"@",
"Override",
"public",
"List",
"<",
"LibraryPolicyReport",
">",
"getApplicationReport",
"(",
"NexusIQApplication",
"application",
")",
"{",
"List",
"<",
"LibraryPolicyReport",
">",
"applicationReports",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"String",
"... | Get report links for a given application.
@param application nexus application
@return a list of report links | [
"Get",
"report",
"links",
"for",
"a",
"given",
"application",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/library-policy/nexus-iq-collector/src/main/java/com/capitalone/dashboard/collector/DefaultNexusIQClient.java#L98-L123 |
131,636 | Hygieia/Hygieia | collectors/build/jenkins/src/main/java/com/capitalone/dashboard/collector/DefaultHudsonClient.java | DefaultHudsonClient.rebuildJobUrl | public static String rebuildJobUrl(String build, String server) throws URISyntaxException, MalformedURLException, UnsupportedEncodingException {
URL instanceUrl = new URL(server);
String userInfo = instanceUrl.getUserInfo();
String instanceProtocol = instanceUrl.getProtocol();
//decode ... | java | public static String rebuildJobUrl(String build, String server) throws URISyntaxException, MalformedURLException, UnsupportedEncodingException {
URL instanceUrl = new URL(server);
String userInfo = instanceUrl.getUserInfo();
String instanceProtocol = instanceUrl.getProtocol();
//decode ... | [
"public",
"static",
"String",
"rebuildJobUrl",
"(",
"String",
"build",
",",
"String",
"server",
")",
"throws",
"URISyntaxException",
",",
"MalformedURLException",
",",
"UnsupportedEncodingException",
"{",
"URL",
"instanceUrl",
"=",
"new",
"URL",
"(",
"server",
")",
... | does not save the auth user info and we need to add it back. | [
"does",
"not",
"save",
"the",
"auth",
"user",
"info",
"and",
"we",
"need",
"to",
"add",
"it",
"back",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/build/jenkins/src/main/java/com/capitalone/dashboard/collector/DefaultHudsonClient.java#L381-L394 |
131,637 | Hygieia/Hygieia | collectors/feature/rally/src/main/java/com/capitalone/dashboard/collector/DefaultRallyClient.java | DefaultRallyClient.getRemainingDays | public int getRemainingDays(String startDate, String endDate, Date currentDate) throws java.text.ParseException {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar iterationEndDate = Calendar.getInstance();
iterationEndDate.setTime(dateFormat.parse(endDate));
Calendar iterationStartDate = C... | java | public int getRemainingDays(String startDate, String endDate, Date currentDate) throws java.text.ParseException {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar iterationEndDate = Calendar.getInstance();
iterationEndDate.setTime(dateFormat.parse(endDate));
Calendar iterationStartDate = C... | [
"public",
"int",
"getRemainingDays",
"(",
"String",
"startDate",
",",
"String",
"endDate",
",",
"Date",
"currentDate",
")",
"throws",
"java",
".",
"text",
".",
"ParseException",
"{",
"DateFormat",
"dateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyy-MM-dd\""... | Helper method to find the remaining days | [
"Helper",
"method",
"to",
"find",
"the",
"remaining",
"days"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/rally/src/main/java/com/capitalone/dashboard/collector/DefaultRallyClient.java#L420-L449 |
131,638 | Hygieia/Hygieia | api-audit/src/main/java/com/capitalone/dashboard/evaluator/StaticSecurityAnalysisEvaluator.java | StaticSecurityAnalysisEvaluator.getStaticSecurityScanResponse | private SecurityReviewAuditResponse getStaticSecurityScanResponse(CollectorItem collectorItem, long beginDate, long endDate) {
List<CodeQuality> codeQualities = codeQualityRepository.findByCollectorItemIdAndTimestampIsBetweenOrderByTimestampDesc(collectorItem.getId(), beginDate - 1, endDate + 1);
Secur... | java | private SecurityReviewAuditResponse getStaticSecurityScanResponse(CollectorItem collectorItem, long beginDate, long endDate) {
List<CodeQuality> codeQualities = codeQualityRepository.findByCollectorItemIdAndTimestampIsBetweenOrderByTimestampDesc(collectorItem.getId(), beginDate - 1, endDate + 1);
Secur... | [
"private",
"SecurityReviewAuditResponse",
"getStaticSecurityScanResponse",
"(",
"CollectorItem",
"collectorItem",
",",
"long",
"beginDate",
",",
"long",
"endDate",
")",
"{",
"List",
"<",
"CodeQuality",
">",
"codeQualities",
"=",
"codeQualityRepository",
".",
"findByCollec... | Reusable method for constructing the CodeQualityAuditResponse object
@param collectorItem Collector Item
@param beginDate Begin Date
@param endDate End Date
@return SecurityReviewAuditResponse | [
"Reusable",
"method",
"for",
"constructing",
"the",
"CodeQualityAuditResponse",
"object"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api-audit/src/main/java/com/capitalone/dashboard/evaluator/StaticSecurityAnalysisEvaluator.java#L63-L92 |
131,639 | Hygieia/Hygieia | collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/DefaultAWSCloudClient.java | DefaultAWSCloudClient.getCloudInstances | @Override
public Map<String, List<CloudInstance>> getCloudInstances(CloudInstanceRepository repository) {
DescribeInstancesResult instanceResult;
if (null == settings.getFilters() || settings.getFilters().isEmpty() ) {
instanceResult = ec2Client.describeInstances();
} else {
... | java | @Override
public Map<String, List<CloudInstance>> getCloudInstances(CloudInstanceRepository repository) {
DescribeInstancesResult instanceResult;
if (null == settings.getFilters() || settings.getFilters().isEmpty() ) {
instanceResult = ec2Client.describeInstances();
} else {
... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"CloudInstance",
">",
">",
"getCloudInstances",
"(",
"CloudInstanceRepository",
"repository",
")",
"{",
"DescribeInstancesResult",
"instanceResult",
";",
"if",
"(",
"null",
"==",
"settings",
".",
... | Calls AWS API and collects instance details.
@param repository
@return List of CloudInstance | [
"Calls",
"AWS",
"API",
"and",
"collects",
"instance",
"details",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/DefaultAWSCloudClient.java#L99-L147 |
131,640 | Hygieia/Hygieia | collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/DefaultAWSCloudClient.java | DefaultAWSCloudClient.getCloudInstanceDetails | private CloudInstance getCloudInstanceDetails(String account,
Instance currInstance, Map<String, String> autoScaleMap, CloudInstanceRepository repository) {
long lastUpdated = System.currentTimeMillis();
CloudInstance instance = repository.findByInstanc... | java | private CloudInstance getCloudInstanceDetails(String account,
Instance currInstance, Map<String, String> autoScaleMap, CloudInstanceRepository repository) {
long lastUpdated = System.currentTimeMillis();
CloudInstance instance = repository.findByInstanc... | [
"private",
"CloudInstance",
"getCloudInstanceDetails",
"(",
"String",
"account",
",",
"Instance",
"currInstance",
",",
"Map",
"<",
"String",
",",
"String",
">",
"autoScaleMap",
",",
"CloudInstanceRepository",
"repository",
")",
"{",
"long",
"lastUpdated",
"=",
"Syst... | Fill out the CloudInstance object
@param account Cloud Account
@param currInstance Cloud Instance
@param repository CloudInstnceRepository
@return A single CloudInstance | [
"Fill",
"out",
"the",
"CloudInstance",
"object"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/DefaultAWSCloudClient.java#L157-L204 |
131,641 | Hygieia/Hygieia | collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/DefaultAWSCloudClient.java | DefaultAWSCloudClient.getCloudVolumes | public Map<String, List<CloudVolumeStorage>> getCloudVolumes(Map<String, String> instanceToAccountMap) {
Map<String, List<CloudVolumeStorage>> returnMap = new HashMap<>();
DescribeVolumesResult volumeResult = ec2Client.describeVolumes();
for (Volume v : volumeResult.getVolumes()) {
C... | java | public Map<String, List<CloudVolumeStorage>> getCloudVolumes(Map<String, String> instanceToAccountMap) {
Map<String, List<CloudVolumeStorage>> returnMap = new HashMap<>();
DescribeVolumesResult volumeResult = ec2Client.describeVolumes();
for (Volume v : volumeResult.getVolumes()) {
C... | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"CloudVolumeStorage",
">",
">",
"getCloudVolumes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"instanceToAccountMap",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"CloudVolumeStorage",
">",
">",
"r... | Returns a map of account number of list of volumes associated with the account
@param instanceToAccountMap
@return Map of account number and a list of Volumes | [
"Returns",
"a",
"map",
"of",
"account",
"number",
"of",
"list",
"of",
"volumes",
"associated",
"with",
"the",
"account"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/DefaultAWSCloudClient.java#L213-L252 |
131,642 | Hygieia/Hygieia | collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/BuildWidgetScore.java | BuildWidgetScore.fetchBuildSuccessRatio | private Double fetchBuildSuccessRatio(Iterable<Build> builds) {
int totalBuilds = 0, totalSuccess = 0;
for (Build build : builds) {
if (Constants.IGNORE_STATUS.contains(build.getBuildStatus())) {
continue;
}
totalBuilds++;
if (Constants.SUCCESS_STATUS.contains(build.getBuildStat... | java | private Double fetchBuildSuccessRatio(Iterable<Build> builds) {
int totalBuilds = 0, totalSuccess = 0;
for (Build build : builds) {
if (Constants.IGNORE_STATUS.contains(build.getBuildStatus())) {
continue;
}
totalBuilds++;
if (Constants.SUCCESS_STATUS.contains(build.getBuildStat... | [
"private",
"Double",
"fetchBuildSuccessRatio",
"(",
"Iterable",
"<",
"Build",
">",
"builds",
")",
"{",
"int",
"totalBuilds",
"=",
"0",
",",
"totalSuccess",
"=",
"0",
";",
"for",
"(",
"Build",
"build",
":",
"builds",
")",
"{",
"if",
"(",
"Constants",
".",... | Calculate percentage of successful builds
Any build with status InProgress, Aborted is excluded from calculation
Builds with status as Success, Unstable is included as success build
@param builds iterable build
@return percentage of build success | [
"Calculate",
"percentage",
"of",
"successful",
"builds",
"Any",
"build",
"with",
"status",
"InProgress",
"Aborted",
"is",
"excluded",
"from",
"calculation",
"Builds",
"with",
"status",
"as",
"Success",
"Unstable",
"is",
"included",
"as",
"success",
"build"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/BuildWidgetScore.java#L194-L210 |
131,643 | Hygieia/Hygieia | collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/BuildWidgetScore.java | BuildWidgetScore.fetchBuildDurationWithinThresholdRatio | private Double fetchBuildDurationWithinThresholdRatio(Iterable<Build> builds, long thresholdInMillis) {
int totalBuilds = 0, totalBelowThreshold = 0;
for (Build build : builds) {
if (!Constants.SUCCESS_STATUS.contains(build.getBuildStatus())) {
continue;
}
totalBuilds++;
if (bui... | java | private Double fetchBuildDurationWithinThresholdRatio(Iterable<Build> builds, long thresholdInMillis) {
int totalBuilds = 0, totalBelowThreshold = 0;
for (Build build : builds) {
if (!Constants.SUCCESS_STATUS.contains(build.getBuildStatus())) {
continue;
}
totalBuilds++;
if (bui... | [
"private",
"Double",
"fetchBuildDurationWithinThresholdRatio",
"(",
"Iterable",
"<",
"Build",
">",
"builds",
",",
"long",
"thresholdInMillis",
")",
"{",
"int",
"totalBuilds",
"=",
"0",
",",
"totalBelowThreshold",
"=",
"0",
";",
"for",
"(",
"Build",
"build",
":",... | Calculate builds that completed successfully within threshold time
Only builds with status as Success, Unstable is included for calculation
@param builds iterable builds
@param thresholdInMillis threshold for build times in milliseconds
@return percentage of builds within threshold | [
"Calculate",
"builds",
"that",
"completed",
"successfully",
"within",
"threshold",
"time",
"Only",
"builds",
"with",
"status",
"as",
"Success",
"Unstable",
"is",
"included",
"for",
"calculation"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/BuildWidgetScore.java#L220-L236 |
131,644 | Hygieia/Hygieia | collectors/cmdb/hpsm/src/main/java/com/capitalone/dashboard/collector/DefaultHpsmClient.java | DefaultHpsmClient.getItemType | private String getItemType(Cmdb cmdb) {
String itemType = null;
String subType = cmdb.getConfigurationItemSubType();
String type = cmdb.getConfigurationItemType();
String hpsmSettingsSubType = hpsmSettings.getAppSubType();
String hpsmSettingsType = hpsmSettings.getAppType();
boolean typeCheck = false;
b... | java | private String getItemType(Cmdb cmdb) {
String itemType = null;
String subType = cmdb.getConfigurationItemSubType();
String type = cmdb.getConfigurationItemType();
String hpsmSettingsSubType = hpsmSettings.getAppSubType();
String hpsmSettingsType = hpsmSettings.getAppType();
boolean typeCheck = false;
b... | [
"private",
"String",
"getItemType",
"(",
"Cmdb",
"cmdb",
")",
"{",
"String",
"itemType",
"=",
"null",
";",
"String",
"subType",
"=",
"cmdb",
".",
"getConfigurationItemSubType",
"(",
")",
";",
"String",
"type",
"=",
"cmdb",
".",
"getConfigurationItemType",
"(",... | Returns the type of the configuration item.
@param cmdb
@return the type of the configuration item. | [
"Returns",
"the",
"type",
"of",
"the",
"configuration",
"item",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/cmdb/hpsm/src/main/java/com/capitalone/dashboard/collector/DefaultHpsmClient.java#L323-L375 |
131,645 | Hygieia/Hygieia | collectors/artifact/artifactory/src/main/java/com/capitalone/dashboard/collector/ArtifactoryCollectorTask.java | ArtifactoryCollectorTask.clean | private void clean(ArtifactoryCollector collector, List<ArtifactoryRepo> existingRepos) {
// find the server url's to collect from
Set<String> serversToBeCollected = new HashSet<>();
serversToBeCollected.addAll(collector.getArtifactoryServers());
// find the repos to collect from e... | java | private void clean(ArtifactoryCollector collector, List<ArtifactoryRepo> existingRepos) {
// find the server url's to collect from
Set<String> serversToBeCollected = new HashSet<>();
serversToBeCollected.addAll(collector.getArtifactoryServers());
// find the repos to collect from e... | [
"private",
"void",
"clean",
"(",
"ArtifactoryCollector",
"collector",
",",
"List",
"<",
"ArtifactoryRepo",
">",
"existingRepos",
")",
"{",
"// find the server url's to collect from\r",
"Set",
"<",
"String",
">",
"serversToBeCollected",
"=",
"new",
"HashSet",
"<>",
"("... | Clean up unused artifactory collector items
@param collector the {@link ArtifactoryCollector} | [
"Clean",
"up",
"unused",
"artifactory",
"collector",
"items"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/artifact/artifactory/src/main/java/com/capitalone/dashboard/collector/ArtifactoryCollectorTask.java#L195-L227 |
131,646 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java | FeatureServiceImpl.getStory | @Override
public DataResponse<List<Feature>> getStory(ObjectId componentId, String storyNumber) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems())
|| CollectionUtils
.isEmpty(component.getCollectorItems().get... | java | @Override
public DataResponse<List<Feature>> getStory(ObjectId componentId, String storyNumber) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems())
|| CollectionUtils
.isEmpty(component.getCollectorItems().get... | [
"@",
"Override",
"public",
"DataResponse",
"<",
"List",
"<",
"Feature",
">",
">",
"getStory",
"(",
"ObjectId",
"componentId",
",",
"String",
"storyNumber",
")",
"{",
"Component",
"component",
"=",
"componentRepository",
".",
"findOne",
"(",
"componentId",
")",
... | Retrieves a single story based on a back-end story number
@param componentId
The ID of the related UI component that will reference
collector item content from this collector
@param storyNumber
A back-end story ID used by a source system
@return A data response list of type Feature containing a single story | [
"Retrieves",
"a",
"single",
"story",
"based",
"on",
"a",
"back",
"-",
"end",
"story",
"number"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java#L91-L111 |
131,647 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java | FeatureServiceImpl.getRelevantStories | @Override
public DataResponse<List<Feature>> getRelevantStories(ObjectId componentId, String teamId, String projectId,
Optional<String> agileType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems())
|| Collection... | java | @Override
public DataResponse<List<Feature>> getRelevantStories(ObjectId componentId, String teamId, String projectId,
Optional<String> agileType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems())
|| Collection... | [
"@",
"Override",
"public",
"DataResponse",
"<",
"List",
"<",
"Feature",
">",
">",
"getRelevantStories",
"(",
"ObjectId",
"componentId",
",",
"String",
"teamId",
",",
"String",
"projectId",
",",
"Optional",
"<",
"String",
">",
"agileType",
")",
"{",
"Component"... | Retrieves all stories for a given team and their current sprint
@param componentId
The ID of the related UI component that will reference
collector item content from this collector
@param teamId
A given scope-owner's source-system ID
@return A data response list of type Feature containing all features for
the given te... | [
"Retrieves",
"all",
"stories",
"for",
"a",
"given",
"team",
"and",
"their",
"current",
"sprint"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java#L124-L147 |
131,648 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java | FeatureServiceImpl.getFeatureEpicEstimates | @Override
public DataResponse<List<Feature>> getFeatureEpicEstimates(ObjectId componentId, String teamId, String projectId,
Optional<String> agileType, Optional<String> estimateMetricType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(compo... | java | @Override
public DataResponse<List<Feature>> getFeatureEpicEstimates(ObjectId componentId, String teamId, String projectId,
Optional<String> agileType, Optional<String> estimateMetricType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(compo... | [
"@",
"Override",
"public",
"DataResponse",
"<",
"List",
"<",
"Feature",
">",
">",
"getFeatureEpicEstimates",
"(",
"ObjectId",
"componentId",
",",
"String",
"teamId",
",",
"String",
"projectId",
",",
"Optional",
"<",
"String",
">",
"agileType",
",",
"Optional",
... | Retrieves all unique super features and their total sub feature estimates
for a given team and their current sprint
@param componentId
The ID of the related UI component that will reference
collector item content from this collector
@param teamId
A given scope-owner's source-system ID
@return A data response list of t... | [
"Retrieves",
"all",
"unique",
"super",
"features",
"and",
"their",
"total",
"sub",
"feature",
"estimates",
"for",
"a",
"given",
"team",
"and",
"their",
"current",
"sprint"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java#L162-L215 |
131,649 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java | FeatureServiceImpl.getInProgressEstimate | @Override
@Deprecated
public DataResponse<List<Feature>> getInProgressEstimate(ObjectId componentId, String teamId,
Optional<String> agileType, Optional<String> estimateMetricType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.ge... | java | @Override
@Deprecated
public DataResponse<List<Feature>> getInProgressEstimate(ObjectId componentId, String teamId,
Optional<String> agileType, Optional<String> estimateMetricType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.ge... | [
"@",
"Override",
"@",
"Deprecated",
"public",
"DataResponse",
"<",
"List",
"<",
"Feature",
">",
">",
"getInProgressEstimate",
"(",
"ObjectId",
"componentId",
",",
"String",
"teamId",
",",
"Optional",
"<",
"String",
">",
"agileType",
",",
"Optional",
"<",
"Stri... | Retrieves estimate in-progress of all features in the current sprint and
for the current team.
@param componentId
The ID of the related UI component that will reference
collector item content from this collector
@param teamId
A given scope-owner's source-system ID
@return A data response list of type Feature containin... | [
"Retrieves",
"estimate",
"in",
"-",
"progress",
"of",
"all",
"features",
"in",
"the",
"current",
"sprint",
"and",
"for",
"the",
"current",
"team",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java#L283-L305 |
131,650 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java | FeatureServiceImpl.getCurrentSprintDetail | @Override
public DataResponse<List<Feature>> getCurrentSprintDetail(ObjectId componentId, String teamId, String projectId,
Optional<String> agileType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems())
|| Collec... | java | @Override
public DataResponse<List<Feature>> getCurrentSprintDetail(ObjectId componentId, String teamId, String projectId,
Optional<String> agileType) {
Component component = componentRepository.findOne(componentId);
if ((component == null) || CollectionUtils.isEmpty(component.getCollectorItems())
|| Collec... | [
"@",
"Override",
"public",
"DataResponse",
"<",
"List",
"<",
"Feature",
">",
">",
"getCurrentSprintDetail",
"(",
"ObjectId",
"componentId",
",",
"String",
"teamId",
",",
"String",
"projectId",
",",
"Optional",
"<",
"String",
">",
"agileType",
")",
"{",
"Compon... | Retrieves the current sprint's detail for a given team.
@param componentId
The ID of the related UI component that will reference
collector item content from this collector
@param teamId
A given scope-owner's source-system ID
@return A data response list of type Feature containing several relevant
sprint fields for th... | [
"Retrieves",
"the",
"current",
"sprint",
"s",
"detail",
"for",
"a",
"given",
"team",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java#L354-L372 |
131,651 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java | FeatureServiceImpl.getFeaturesForCurrentSprints | private List<Feature> getFeaturesForCurrentSprints(String teamId, String projectId, ObjectId collectorId, String agileType, boolean minimal) {
List<Feature> rt = new ArrayList<Feature>();
String now = getCurrentISODateTime();
if ( FeatureCollectorConstants.SPRINT_KANBAN.equalsIgnoreCase(agileType)) {
/* ... | java | private List<Feature> getFeaturesForCurrentSprints(String teamId, String projectId, ObjectId collectorId, String agileType, boolean minimal) {
List<Feature> rt = new ArrayList<Feature>();
String now = getCurrentISODateTime();
if ( FeatureCollectorConstants.SPRINT_KANBAN.equalsIgnoreCase(agileType)) {
/* ... | [
"private",
"List",
"<",
"Feature",
">",
"getFeaturesForCurrentSprints",
"(",
"String",
"teamId",
",",
"String",
"projectId",
",",
"ObjectId",
"collectorId",
",",
"String",
"agileType",
",",
"boolean",
"minimal",
")",
"{",
"List",
"<",
"Feature",
">",
"rt",
"="... | Get the features that belong to the current sprints
@param teamId the team id
@param agileType the agile type. Defaults to "scrum" if null
@param minimal if the resulting list of Features should be minimally populated (see queries for fields)
@return | [
"Get",
"the",
"features",
"that",
"belong",
"to",
"the",
"current",
"sprints"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/FeatureServiceImpl.java#L432-L456 |
131,652 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.getCodeReviewAudit | private static Audit getCodeReviewAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing CODE_REVIEW");
Audit audit = new Audit();
audit.setType(AuditType.CODE_REVIEW);
Audit basicAudit;
if ((basicAudit = doBasicAuditCheck(jsonArray, global, A... | java | private static Audit getCodeReviewAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing CODE_REVIEW");
Audit audit = new Audit();
audit.setType(AuditType.CODE_REVIEW);
Audit basicAudit;
if ((basicAudit = doBasicAuditCheck(jsonArray, global, A... | [
"private",
"static",
"Audit",
"getCodeReviewAudit",
"(",
"JSONArray",
"jsonArray",
",",
"JSONArray",
"global",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"NFRR Audit Collector auditing CODE_REVIEW\"",
")",
";",
"Audit",
"audit",
"=",
"new",
"Audit",
"(",
")",
";",
... | Get Code Review Audit Results | [
"Get",
"Code",
"Review",
"Audit",
"Results"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L89-L133 |
131,653 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.doBasicAuditCheck | private static Audit doBasicAuditCheck(JSONArray jsonArray, JSONArray global, AuditType auditType) {
Audit audit = new Audit();
audit.setType(auditType);
if (!isConfigured(auditType, global)) {
audit.setDataStatus(DataStatus.NOT_CONFIGURED);
audit.setAuditStatus(AuditStat... | java | private static Audit doBasicAuditCheck(JSONArray jsonArray, JSONArray global, AuditType auditType) {
Audit audit = new Audit();
audit.setType(auditType);
if (!isConfigured(auditType, global)) {
audit.setDataStatus(DataStatus.NOT_CONFIGURED);
audit.setAuditStatus(AuditStat... | [
"private",
"static",
"Audit",
"doBasicAuditCheck",
"(",
"JSONArray",
"jsonArray",
",",
"JSONArray",
"global",
",",
"AuditType",
"auditType",
")",
"{",
"Audit",
"audit",
"=",
"new",
"Audit",
"(",
")",
";",
"audit",
".",
"setType",
"(",
"auditType",
")",
";",
... | Do basic audit check - configuration, collector error, no data | [
"Do",
"basic",
"audit",
"check",
"-",
"configuration",
"collector",
"error",
"no",
"data"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L138-L157 |
131,654 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.isCollectorError | private static boolean isCollectorError(JSONArray jsonArray) {
Stream<JSONObject> jsonObjectStream = jsonArray.stream().map((Object object) -> (JSONObject) object);
Stream<JSONArray> auditStatusArray = jsonObjectStream.map(jsonObject -> (JSONArray) jsonObject.get(STR_AUDITSTATUSES));
return audi... | java | private static boolean isCollectorError(JSONArray jsonArray) {
Stream<JSONObject> jsonObjectStream = jsonArray.stream().map((Object object) -> (JSONObject) object);
Stream<JSONArray> auditStatusArray = jsonObjectStream.map(jsonObject -> (JSONArray) jsonObject.get(STR_AUDITSTATUSES));
return audi... | [
"private",
"static",
"boolean",
"isCollectorError",
"(",
"JSONArray",
"jsonArray",
")",
"{",
"Stream",
"<",
"JSONObject",
">",
"jsonObjectStream",
"=",
"jsonArray",
".",
"stream",
"(",
")",
".",
"map",
"(",
"(",
"Object",
"object",
")",
"->",
"(",
"JSONObjec... | Check for collector error | [
"Check",
"for",
"collector",
"error"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L162-L166 |
131,655 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.isConfigured | @SuppressWarnings("PMD.NPathComplexity")
private static boolean isConfigured(AuditType auditType, JSONArray jsonArray) {
if (auditType.equals(AuditType.CODE_REVIEW)) {
return (jsonArray.toJSONString().contains(DashboardAuditStatus.DASHBOARD_REPO_CONFIGURED.name()) ? true : false);
}
... | java | @SuppressWarnings("PMD.NPathComplexity")
private static boolean isConfigured(AuditType auditType, JSONArray jsonArray) {
if (auditType.equals(AuditType.CODE_REVIEW)) {
return (jsonArray.toJSONString().contains(DashboardAuditStatus.DASHBOARD_REPO_CONFIGURED.name()) ? true : false);
}
... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.NPathComplexity\"",
")",
"private",
"static",
"boolean",
"isConfigured",
"(",
"AuditType",
"auditType",
",",
"JSONArray",
"jsonArray",
")",
"{",
"if",
"(",
"auditType",
".",
"equals",
"(",
"AuditType",
".",
"CODE_REVIEW",
")",
... | Check for dashboard audit type configuration | [
"Check",
"for",
"dashboard",
"audit",
"type",
"configuration"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L171-L195 |
131,656 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.getCodeQualityAudit | private static Audit getCodeQualityAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing CODE_QUALITY");
Audit audit = new Audit();
audit.setType(AuditType.CODE_QUALITY);
Audit basicAudit;
if ((basicAudit = doBasicAuditCheck(jsonArray, global,... | java | private static Audit getCodeQualityAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing CODE_QUALITY");
Audit audit = new Audit();
audit.setType(AuditType.CODE_QUALITY);
Audit basicAudit;
if ((basicAudit = doBasicAuditCheck(jsonArray, global,... | [
"private",
"static",
"Audit",
"getCodeQualityAudit",
"(",
"JSONArray",
"jsonArray",
",",
"JSONArray",
"global",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"NFRR Audit Collector auditing CODE_QUALITY\"",
")",
";",
"Audit",
"audit",
"=",
"new",
"Audit",
"(",
")",
";",
... | Get code quality audit results | [
"Get",
"code",
"quality",
"audit",
"results"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L201-L237 |
131,657 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.getSecurityAudit | private static Audit getSecurityAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing STATIC_SECURITY_ANALYSIS");
Audit audit = new Audit();
audit.setType(AuditType.STATIC_SECURITY_ANALYSIS);
Audit basicAudit;
if ((basicAudit = doBasicAuditChe... | java | private static Audit getSecurityAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing STATIC_SECURITY_ANALYSIS");
Audit audit = new Audit();
audit.setType(AuditType.STATIC_SECURITY_ANALYSIS);
Audit basicAudit;
if ((basicAudit = doBasicAuditChe... | [
"private",
"static",
"Audit",
"getSecurityAudit",
"(",
"JSONArray",
"jsonArray",
",",
"JSONArray",
"global",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"NFRR Audit Collector auditing STATIC_SECURITY_ANALYSIS\"",
")",
";",
"Audit",
"audit",
"=",
"new",
"Audit",
"(",
")"... | Get security audit results | [
"Get",
"security",
"audit",
"results"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L243-L273 |
131,658 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.getOSSAudit | private static Audit getOSSAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing LIBRARY_POLICY");
Audit audit = new Audit();
audit.setType(AuditType.LIBRARY_POLICY);
Audit basicAudit;
if ((basicAudit = doBasicAuditCheck(jsonArray, global, Au... | java | private static Audit getOSSAudit(JSONArray jsonArray, JSONArray global) {
LOGGER.info("NFRR Audit Collector auditing LIBRARY_POLICY");
Audit audit = new Audit();
audit.setType(AuditType.LIBRARY_POLICY);
Audit basicAudit;
if ((basicAudit = doBasicAuditCheck(jsonArray, global, Au... | [
"private",
"static",
"Audit",
"getOSSAudit",
"(",
"JSONArray",
"jsonArray",
",",
"JSONArray",
"global",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"NFRR Audit Collector auditing LIBRARY_POLICY\"",
")",
";",
"Audit",
"audit",
"=",
"new",
"Audit",
"(",
")",
";",
"aud... | Get library policy audit results | [
"Get",
"library",
"policy",
"audit",
"results"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L279-L316 |
131,659 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.getAudit | @SuppressWarnings("PMD")
public static Map<AuditType, Audit> getAudit(Dashboard dashboard, AuditSettings settings, long begin, long end) {
Map<AuditType, Audit> audits = new HashMap<>();
String url = getAuditAPIUrl(dashboard, settings, begin, end);
JSONObject auditResponseObj = parseObject(... | java | @SuppressWarnings("PMD")
public static Map<AuditType, Audit> getAudit(Dashboard dashboard, AuditSettings settings, long begin, long end) {
Map<AuditType, Audit> audits = new HashMap<>();
String url = getAuditAPIUrl(dashboard, settings, begin, end);
JSONObject auditResponseObj = parseObject(... | [
"@",
"SuppressWarnings",
"(",
"\"PMD\"",
")",
"public",
"static",
"Map",
"<",
"AuditType",
",",
"Audit",
">",
"getAudit",
"(",
"Dashboard",
"dashboard",
",",
"AuditSettings",
"settings",
",",
"long",
"begin",
",",
"long",
"end",
")",
"{",
"Map",
"<",
"Audi... | Get all audit results | [
"Get",
"all",
"audit",
"results"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L402-L438 |
131,660 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.parseObject | protected static JSONObject parseObject(String url, AuditSettings settings){
LOGGER.info("NFRR Audit Collector Audit API Call");
RestTemplate restTemplate = new RestTemplate();
JSONObject responseObj = null;
try {
ResponseEntity<String> response = restTemplate.exchange(url, H... | java | protected static JSONObject parseObject(String url, AuditSettings settings){
LOGGER.info("NFRR Audit Collector Audit API Call");
RestTemplate restTemplate = new RestTemplate();
JSONObject responseObj = null;
try {
ResponseEntity<String> response = restTemplate.exchange(url, H... | [
"protected",
"static",
"JSONObject",
"parseObject",
"(",
"String",
"url",
",",
"AuditSettings",
"settings",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"NFRR Audit Collector Audit API Call\"",
")",
";",
"RestTemplate",
"restTemplate",
"=",
"new",
"RestTemplate",
"(",
")... | Make audit api rest call and parse response | [
"Make",
"audit",
"api",
"rest",
"call",
"and",
"parse",
"response"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L443-L455 |
131,661 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.getAuditAPIUrl | protected static String getAuditAPIUrl(Dashboard dashboard, AuditSettings settings, long beginDate, long endDate) {
LOGGER.info("NFRR Audit Collector creates Audit API URL");
if (CollectionUtils.isEmpty(settings.getServers())) {
LOGGER.error("No Server Found to run NoFearRelease audit collec... | java | protected static String getAuditAPIUrl(Dashboard dashboard, AuditSettings settings, long beginDate, long endDate) {
LOGGER.info("NFRR Audit Collector creates Audit API URL");
if (CollectionUtils.isEmpty(settings.getServers())) {
LOGGER.error("No Server Found to run NoFearRelease audit collec... | [
"protected",
"static",
"String",
"getAuditAPIUrl",
"(",
"Dashboard",
"dashboard",
",",
"AuditSettings",
"settings",
",",
"long",
"beginDate",
",",
"long",
"endDate",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"NFRR Audit Collector creates Audit API URL\"",
")",
";",
"i... | Construct audit api url | [
"Construct",
"audit",
"api",
"url"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L460-L476 |
131,662 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.getHeaders | protected static HttpEntity getHeaders(AuditSettings auditSettings) {
HttpHeaders headers = new HttpHeaders();
if (!CollectionUtils.isEmpty(auditSettings.getUsernames()) && !CollectionUtils.isEmpty(auditSettings.getApiKeys())) {
headers.set(STR_APIUSER, auditSettings.getUsernames().iterator(... | java | protected static HttpEntity getHeaders(AuditSettings auditSettings) {
HttpHeaders headers = new HttpHeaders();
if (!CollectionUtils.isEmpty(auditSettings.getUsernames()) && !CollectionUtils.isEmpty(auditSettings.getApiKeys())) {
headers.set(STR_APIUSER, auditSettings.getUsernames().iterator(... | [
"protected",
"static",
"HttpEntity",
"getHeaders",
"(",
"AuditSettings",
"auditSettings",
")",
"{",
"HttpHeaders",
"headers",
"=",
"new",
"HttpHeaders",
"(",
")",
";",
"if",
"(",
"!",
"CollectionUtils",
".",
"isEmpty",
"(",
"auditSettings",
".",
"getUsernames",
... | Get api authentication headers | [
"Get",
"api",
"authentication",
"headers"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L481-L488 |
131,663 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java | AuditCollectorUtil.addAuditResultByAuditType | @SuppressWarnings("PMD.NPathComplexity")
public static void addAuditResultByAuditType(Dashboard dashboard, Map<AuditType, Audit> auditMap, CmdbRepository cmdbRepository, long timestamp) {
if(CollectionUtils.isEmpty(auditMap)){ return; }
Cmdb cmdb = cmdbRepository.findByConfigurationItem(dashboard.g... | java | @SuppressWarnings("PMD.NPathComplexity")
public static void addAuditResultByAuditType(Dashboard dashboard, Map<AuditType, Audit> auditMap, CmdbRepository cmdbRepository, long timestamp) {
if(CollectionUtils.isEmpty(auditMap)){ return; }
Cmdb cmdb = cmdbRepository.findByConfigurationItem(dashboard.g... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.NPathComplexity\"",
")",
"public",
"static",
"void",
"addAuditResultByAuditType",
"(",
"Dashboard",
"dashboard",
",",
"Map",
"<",
"AuditType",
",",
"Audit",
">",
"auditMap",
",",
"CmdbRepository",
"cmdbRepository",
",",
"long",
"... | Add audit result by audit type | [
"Add",
"audit",
"result",
"by",
"audit",
"type"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorUtil.java#L493-L516 |
131,664 | Hygieia/Hygieia | collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/DeployWidgetScore.java | DeployWidgetScore.fetchDeploySuccessRatio | private Double fetchDeploySuccessRatio(ObjectId collectorItemId) {
int totalDeploys = 0, totalDeploySuccess = 0;
Double deploySuccessScore = null;
List<EnvironmentComponent> components = environmentComponentRepository
.findByCollectorItemId(collectorItemId);
if (null == components || components.... | java | private Double fetchDeploySuccessRatio(ObjectId collectorItemId) {
int totalDeploys = 0, totalDeploySuccess = 0;
Double deploySuccessScore = null;
List<EnvironmentComponent> components = environmentComponentRepository
.findByCollectorItemId(collectorItemId);
if (null == components || components.... | [
"private",
"Double",
"fetchDeploySuccessRatio",
"(",
"ObjectId",
"collectorItemId",
")",
"{",
"int",
"totalDeploys",
"=",
"0",
",",
"totalDeploySuccess",
"=",
"0",
";",
"Double",
"deploySuccessScore",
"=",
"null",
";",
"List",
"<",
"EnvironmentComponent",
">",
"co... | Calculate percentage of successfully deployed components
@param collectorItemId Collector Item Id of deploy
@return percentage of deployed components | [
"Calculate",
"percentage",
"of",
"successfully",
"deployed",
"components"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/DeployWidgetScore.java#L192-L213 |
131,665 | Hygieia/Hygieia | collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/DeployWidgetScore.java | DeployWidgetScore.fetchInstancesOnlineRatio | private Double fetchInstancesOnlineRatio(ObjectId collectorItemId) {
int totalInstances = 0, totalInstancesOnline = 0;
Double instancesOnlineScore = null;
List<EnvironmentStatus> statuses = environmentStatusRepository
.findByCollectorItemId(collectorItemId);
if (null == statuses || statuses.isEm... | java | private Double fetchInstancesOnlineRatio(ObjectId collectorItemId) {
int totalInstances = 0, totalInstancesOnline = 0;
Double instancesOnlineScore = null;
List<EnvironmentStatus> statuses = environmentStatusRepository
.findByCollectorItemId(collectorItemId);
if (null == statuses || statuses.isEm... | [
"private",
"Double",
"fetchInstancesOnlineRatio",
"(",
"ObjectId",
"collectorItemId",
")",
"{",
"int",
"totalInstances",
"=",
"0",
",",
"totalInstancesOnline",
"=",
"0",
";",
"Double",
"instancesOnlineScore",
"=",
"null",
";",
"List",
"<",
"EnvironmentStatus",
">",
... | Calculate percentage of instances online
@param collectorItemId Collector Item Id of deploy
@return percentage of instances online | [
"Calculate",
"percentage",
"of",
"instances",
"online"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/misc/score/src/main/java/com/capitalone/dashboard/widget/DeployWidgetScore.java#L221-L242 |
131,666 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java | CodeQualityServiceImpl.getReportURL | private String getReportURL(String projectUrl,String path,String projectId) {
StringBuilder sb = new StringBuilder(projectUrl);
if(!projectUrl.endsWith("/")) {
sb.append("/");
}
sb.append(path)
.append(projectId);
return sb.toString();
} | java | private String getReportURL(String projectUrl,String path,String projectId) {
StringBuilder sb = new StringBuilder(projectUrl);
if(!projectUrl.endsWith("/")) {
sb.append("/");
}
sb.append(path)
.append(projectId);
return sb.toString();
} | [
"private",
"String",
"getReportURL",
"(",
"String",
"projectUrl",
",",
"String",
"path",
",",
"String",
"projectId",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"projectUrl",
")",
";",
"if",
"(",
"!",
"projectUrl",
".",
"endsWith",
"("... | get projectUrl and projectId from collectorItem and form reportUrl | [
"get",
"projectUrl",
"and",
"projectId",
"from",
"collectorItem",
"and",
"form",
"reportUrl"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/CodeQualityServiceImpl.java#L220-L228 |
131,667 | Hygieia/Hygieia | collectors/build/jenkins-codequality/src/main/java/com/capitalone/dashboard/utils/CodeQualityMetricsConverter.java | CodeQualityMetricsConverter.visit | @Override
public void visit(JunitXmlReport report) {
int testsPassed = report.getTests() - report.getFailures() - report.getErrors();
Map<String, Pair<Integer, CodeQualityMetricStatus>> metricsMap = new HashMap<>();
metricsMap.put(TOTAL_NO_OF_TESTS, Pair.of(report.getTests(), CodeQualityMe... | java | @Override
public void visit(JunitXmlReport report) {
int testsPassed = report.getTests() - report.getFailures() - report.getErrors();
Map<String, Pair<Integer, CodeQualityMetricStatus>> metricsMap = new HashMap<>();
metricsMap.put(TOTAL_NO_OF_TESTS, Pair.of(report.getTests(), CodeQualityMe... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"JunitXmlReport",
"report",
")",
"{",
"int",
"testsPassed",
"=",
"report",
".",
"getTests",
"(",
")",
"-",
"report",
".",
"getFailures",
"(",
")",
"-",
"report",
".",
"getErrors",
"(",
")",
";",
"Map",
"... | function tests.. | [
"function",
"tests",
".."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/build/jenkins-codequality/src/main/java/com/capitalone/dashboard/utils/CodeQualityMetricsConverter.java#L40-L60 |
131,668 | Hygieia/Hygieia | collectors/feature/rally/src/main/java/com/capitalone/dashboard/collector/RallyCollectorTask.java | RallyCollectorTask.clean | @SuppressWarnings("PMD.AvoidDeeplyNestedIfStmts") // agreed PMD, fixme
private void clean(RallyCollector collector, List<RallyProject> existingProjects) {
Set<ObjectId> uniqueIDs = new HashSet<>();
for (com.capitalone.dashboard.model.Component comp : dbComponentRepository.findAll()) {
if (comp.getCollectorItems... | java | @SuppressWarnings("PMD.AvoidDeeplyNestedIfStmts") // agreed PMD, fixme
private void clean(RallyCollector collector, List<RallyProject> existingProjects) {
Set<ObjectId> uniqueIDs = new HashSet<>();
for (com.capitalone.dashboard.model.Component comp : dbComponentRepository.findAll()) {
if (comp.getCollectorItems... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.AvoidDeeplyNestedIfStmts\"",
")",
"// agreed PMD, fixme",
"private",
"void",
"clean",
"(",
"RallyCollector",
"collector",
",",
"List",
"<",
"RallyProject",
">",
"existingProjects",
")",
"{",
"Set",
"<",
"ObjectId",
">",
"uniqueIDs"... | Clean up unused rally collector items
@param collector
the {@link RallyCollector} | [
"Clean",
"up",
"unused",
"rally",
"collector",
"items"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/rally/src/main/java/com/capitalone/dashboard/collector/RallyCollectorTask.java#L160-L205 |
131,669 | Hygieia/Hygieia | collectors/feature/versionone/src/main/java/com/capitalone/dashboard/util/DateUtil.java | DateUtil.getChangeDateMinutePrior | public static String getChangeDateMinutePrior(String changeDateISO, int priorMinutes) {
return DateUtil.toISODateRealTimeFormat(DateUtil.getDatePriorToMinutes(
DateUtil.fromISODateTimeFormat(changeDateISO), priorMinutes));
} | java | public static String getChangeDateMinutePrior(String changeDateISO, int priorMinutes) {
return DateUtil.toISODateRealTimeFormat(DateUtil.getDatePriorToMinutes(
DateUtil.fromISODateTimeFormat(changeDateISO), priorMinutes));
} | [
"public",
"static",
"String",
"getChangeDateMinutePrior",
"(",
"String",
"changeDateISO",
",",
"int",
"priorMinutes",
")",
"{",
"return",
"DateUtil",
".",
"toISODateRealTimeFormat",
"(",
"DateUtil",
".",
"getDatePriorToMinutes",
"(",
"DateUtil",
".",
"fromISODateTimeFor... | Generates and retrieves the change date that occurs a minute prior to the
specified change date in ISO format.
@param changeDateISO
A given change date in ISO format
@return The ISO-formatted date/time stamp for a minute prior to the given
change date | [
"Generates",
"and",
"retrieves",
"the",
"change",
"date",
"that",
"occurs",
"a",
"minute",
"prior",
"to",
"the",
"specified",
"change",
"date",
"in",
"ISO",
"format",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/versionone/src/main/java/com/capitalone/dashboard/util/DateUtil.java#L55-L58 |
131,670 | Hygieia/Hygieia | collectors/feature/versionone/src/main/java/com/capitalone/dashboard/util/DateUtil.java | DateUtil.evaluateSprintLength | public boolean evaluateSprintLength(String startDate, String endDate, int maxKanbanIterationLength) {
boolean sprintIndicator = false;
Calendar startCalendar = Calendar.getInstance();
Calendar endCalendar = Calendar.getInstance();
if (!StringUtils.isAnyEmpty(startDate) && !StringUtils.isAnyEmpty(endDate)) {
... | java | public boolean evaluateSprintLength(String startDate, String endDate, int maxKanbanIterationLength) {
boolean sprintIndicator = false;
Calendar startCalendar = Calendar.getInstance();
Calendar endCalendar = Calendar.getInstance();
if (!StringUtils.isAnyEmpty(startDate) && !StringUtils.isAnyEmpty(endDate)) {
... | [
"public",
"boolean",
"evaluateSprintLength",
"(",
"String",
"startDate",
",",
"String",
"endDate",
",",
"int",
"maxKanbanIterationLength",
")",
"{",
"boolean",
"sprintIndicator",
"=",
"false",
";",
"Calendar",
"startCalendar",
"=",
"Calendar",
".",
"getInstance",
"(... | Evaluates whether a sprint length appears to be kanban or scrum
@param startDate
The start date of a sprint in ISO format
@param endDate
The end date of a sprint in ISO format
@return True indicates a scrum sprint; False indicates a Kanban sprint | [
"Evaluates",
"whether",
"a",
"sprint",
"length",
"appears",
"to",
"be",
"kanban",
"or",
"scrum"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/versionone/src/main/java/com/capitalone/dashboard/util/DateUtil.java#L85-L114 |
131,671 | Hygieia/Hygieia | collectors/feature/versionone/src/main/java/com/capitalone/dashboard/util/DateUtil.java | DateUtil.isInteger | private boolean isInteger(String s, int radix) {
Scanner sc = new Scanner(s.trim());
if (!sc.hasNextInt(radix))
return false;
// we know it starts with a valid int, now make sure
// there's nothing left!
sc.nextInt(radix);
return !sc.hasNext();
} | java | private boolean isInteger(String s, int radix) {
Scanner sc = new Scanner(s.trim());
if (!sc.hasNextInt(radix))
return false;
// we know it starts with a valid int, now make sure
// there's nothing left!
sc.nextInt(radix);
return !sc.hasNext();
} | [
"private",
"boolean",
"isInteger",
"(",
"String",
"s",
",",
"int",
"radix",
")",
"{",
"Scanner",
"sc",
"=",
"new",
"Scanner",
"(",
"s",
".",
"trim",
"(",
")",
")",
";",
"if",
"(",
"!",
"sc",
".",
"hasNextInt",
"(",
"radix",
")",
")",
"return",
"f... | Determines if string is an integer of the radix base number system
provided.
@param s
String to be evaluated for integer type
@param radix
Base number system (e.g., 10 = base 10 number system)
@return boolean | [
"Determines",
"if",
"string",
"is",
"an",
"integer",
"of",
"the",
"radix",
"base",
"number",
"system",
"provided",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/versionone/src/main/java/com/capitalone/dashboard/util/DateUtil.java#L126-L134 |
131,672 | Hygieia/Hygieia | api-audit/src/main/java/com/capitalone/dashboard/evaluator/LibraryPolicyEvaluator.java | LibraryPolicyEvaluator.getLibraryPolicyAuditResponse | private LibraryPolicyAuditResponse getLibraryPolicyAuditResponse(CollectorItem collectorItem, long beginDate, long endDate) {
List<LibraryPolicyResult> libraryPolicyResults = libraryPolicyResultsRepository.findByCollectorItemIdAndEvaluationTimestampIsBetweenOrderByTimestampDesc(collectorItem.getId(), beginDate ... | java | private LibraryPolicyAuditResponse getLibraryPolicyAuditResponse(CollectorItem collectorItem, long beginDate, long endDate) {
List<LibraryPolicyResult> libraryPolicyResults = libraryPolicyResultsRepository.findByCollectorItemIdAndEvaluationTimestampIsBetweenOrderByTimestampDesc(collectorItem.getId(), beginDate ... | [
"private",
"LibraryPolicyAuditResponse",
"getLibraryPolicyAuditResponse",
"(",
"CollectorItem",
"collectorItem",
",",
"long",
"beginDate",
",",
"long",
"endDate",
")",
"{",
"List",
"<",
"LibraryPolicyResult",
">",
"libraryPolicyResults",
"=",
"libraryPolicyResultsRepository",... | Reusable method for constructing the LibraryPolicyAuditResponse object
@param collectorItem Collector item
@param beginDate Begin Date
@param endDate End Date
@return SecurityReviewAuditResponse | [
"Reusable",
"method",
"for",
"constructing",
"the",
"LibraryPolicyAuditResponse",
"object"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api-audit/src/main/java/com/capitalone/dashboard/evaluator/LibraryPolicyEvaluator.java#L61-L108 |
131,673 | Hygieia/Hygieia | collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java | VersionOneDataFactoryImpl.versionOneAuthentication | private V1Connector versionOneAuthentication(Map<String, String> auth) throws HygieiaException {
V1Connector connector;
try {
if (!StringUtils.isEmpty(auth.get("v1ProxyUrl"))) {
ProxyProvider proxyProvider = new ProxyProvider(new URI(auth.get("v1ProxyUrl")), "",
... | java | private V1Connector versionOneAuthentication(Map<String, String> auth) throws HygieiaException {
V1Connector connector;
try {
if (!StringUtils.isEmpty(auth.get("v1ProxyUrl"))) {
ProxyProvider proxyProvider = new ProxyProvider(new URI(auth.get("v1ProxyUrl")), "",
... | [
"private",
"V1Connector",
"versionOneAuthentication",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"auth",
")",
"throws",
"HygieiaException",
"{",
"V1Connector",
"connector",
";",
"try",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"auth",
".",
... | Used for establishing connection to VersionOne based on authentication
@param auth A key-value pairing of authentication values
@return A V1Connector connection instance | [
"Used",
"for",
"establishing",
"connection",
"to",
"VersionOne",
"based",
"on",
"authentication"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java#L90-L116 |
131,674 | Hygieia/Hygieia | collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java | VersionOneDataFactoryImpl.buildPagingQuery | public String buildPagingQuery(int inPageIndex) {
this.setPageIndex(inPageIndex);
String pageFilter = "\npage:\n" + " size: " + pageSize + "\n" + " start: " + pageIndex;
this.setPagingQuery(this.getBasicQuery() + pageFilter);
return this.getPagingQuery();
} | java | public String buildPagingQuery(int inPageIndex) {
this.setPageIndex(inPageIndex);
String pageFilter = "\npage:\n" + " size: " + pageSize + "\n" + " start: " + pageIndex;
this.setPagingQuery(this.getBasicQuery() + pageFilter);
return this.getPagingQuery();
} | [
"public",
"String",
"buildPagingQuery",
"(",
"int",
"inPageIndex",
")",
"{",
"this",
".",
"setPageIndex",
"(",
"inPageIndex",
")",
";",
"String",
"pageFilter",
"=",
"\"\\npage:\\n\"",
"+",
"\" size: \"",
"+",
"pageSize",
"+",
"\"\\n\"",
"+",
"\" start: \"",
... | Creates a query on demand based on a given basic query and a specified
page index value. It is recommended to use this method in a loop to
ensure all pages are covered.
@param inPageIndex A given query's current page index, from 0-oo
@return A JSON-formatted response | [
"Creates",
"a",
"query",
"on",
"demand",
"based",
"on",
"a",
"given",
"basic",
"query",
"and",
"a",
"specified",
"page",
"index",
"value",
".",
"It",
"is",
"recommended",
"to",
"use",
"this",
"method",
"in",
"a",
"loop",
"to",
"ensure",
"all",
"pages",
... | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java#L127-L132 |
131,675 | Hygieia/Hygieia | collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java | VersionOneDataFactoryImpl.getPagingQueryResponse | public JSONArray getPagingQueryResponse() throws HygieiaException {
synchronized (this.v1Service) {
Object obj = this.v1Service.executePassThroughQuery(this.getPagingQuery());
if (obj == null) {
throw new HygieiaException(
"FAILED: There was a pro... | java | public JSONArray getPagingQueryResponse() throws HygieiaException {
synchronized (this.v1Service) {
Object obj = this.v1Service.executePassThroughQuery(this.getPagingQuery());
if (obj == null) {
throw new HygieiaException(
"FAILED: There was a pro... | [
"public",
"JSONArray",
"getPagingQueryResponse",
"(",
")",
"throws",
"HygieiaException",
"{",
"synchronized",
"(",
"this",
".",
"v1Service",
")",
"{",
"Object",
"obj",
"=",
"this",
".",
"v1Service",
".",
"executePassThroughQuery",
"(",
"this",
".",
"getPagingQuery... | Runs the VersionOneConnection library tools against a given
YAML-formatted query. This requires a pre-formatted paged query to run,
and will not perform the paging for you - there are other helper methods
for this.
@return A formatted JSONArray response
@throws HygieiaException | [
"Runs",
"the",
"VersionOneConnection",
"library",
"tools",
"against",
"a",
"given",
"YAML",
"-",
"formatted",
"query",
".",
"This",
"requires",
"a",
"pre",
"-",
"formatted",
"paged",
"query",
"to",
"run",
"and",
"will",
"not",
"perform",
"the",
"paging",
"fo... | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java#L143-L161 |
131,676 | Hygieia/Hygieia | collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java | VersionOneDataFactoryImpl.makeJsonOutputArray | private JSONArray makeJsonOutputArray(String stringResult) {
JSONParser parser = new JSONParser();
try {
return (JSONArray) parser.parse(stringResult);
} catch (ParseException | ClassCastException e) {
LOGGER.error(
"There was a problem parsing the JSO... | java | private JSONArray makeJsonOutputArray(String stringResult) {
JSONParser parser = new JSONParser();
try {
return (JSONArray) parser.parse(stringResult);
} catch (ParseException | ClassCastException e) {
LOGGER.error(
"There was a problem parsing the JSO... | [
"private",
"JSONArray",
"makeJsonOutputArray",
"(",
"String",
"stringResult",
")",
"{",
"JSONParser",
"parser",
"=",
"new",
"JSONParser",
"(",
")",
";",
"try",
"{",
"return",
"(",
"JSONArray",
")",
"parser",
".",
"parse",
"(",
"stringResult",
")",
";",
"}",
... | Mutator method for JSON response output array. | [
"Mutator",
"method",
"for",
"JSON",
"response",
"output",
"array",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/versionone/src/main/java/com/capitalone/dashboard/datafactory/versionone/VersionOneDataFactoryImpl.java#L220-L230 |
131,677 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.getCollector | @Override
public FeatureCollector getCollector() {
JiraMode mode = featureSettings.isJiraBoardAsTeam() ? JiraMode.Board : JiraMode.Team;
FeatureCollector collector = FeatureCollector.prototype(mode);
FeatureCollector existing = featureCollectorRepository.findByName(collector.getName());
... | java | @Override
public FeatureCollector getCollector() {
JiraMode mode = featureSettings.isJiraBoardAsTeam() ? JiraMode.Board : JiraMode.Team;
FeatureCollector collector = FeatureCollector.prototype(mode);
FeatureCollector existing = featureCollectorRepository.findByName(collector.getName());
... | [
"@",
"Override",
"public",
"FeatureCollector",
"getCollector",
"(",
")",
"{",
"JiraMode",
"mode",
"=",
"featureSettings",
".",
"isJiraBoardAsTeam",
"(",
")",
"?",
"JiraMode",
".",
"Board",
":",
"JiraMode",
".",
"Team",
";",
"FeatureCollector",
"collector",
"=",
... | Accessor method for the collector prototype object | [
"Accessor",
"method",
"for",
"the",
"collector",
"prototype",
"object"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L85-L94 |
131,678 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.updateTeamInformation | protected List<Team> updateTeamInformation(FeatureCollector collector) {
long projectDataStart = System.currentTimeMillis();
List<Team> teams = featureSettings.isJiraBoardAsTeam() ? jiraClient.getBoards() : jiraClient.getTeams();
//Add or update teams that we got from api
teams.forEach(n... | java | protected List<Team> updateTeamInformation(FeatureCollector collector) {
long projectDataStart = System.currentTimeMillis();
List<Team> teams = featureSettings.isJiraBoardAsTeam() ? jiraClient.getBoards() : jiraClient.getTeams();
//Add or update teams that we got from api
teams.forEach(n... | [
"protected",
"List",
"<",
"Team",
">",
"updateTeamInformation",
"(",
"FeatureCollector",
"collector",
")",
"{",
"long",
"projectDataStart",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"List",
"<",
"Team",
">",
"teams",
"=",
"featureSettings",
".",
... | Update team information
@param collector
@return list of teams collected | [
"Update",
"team",
"information"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L168-L200 |
131,679 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.updateProjectInformation | protected Set<Scope> updateProjectInformation(Collector collector) {
long projectDataStart = System.currentTimeMillis();
//Add or update teams that we got from api
Set<Scope> projects = jiraClient.getProjects();
projects.forEach(jiraScope -> {
LOGGER.info(String.format("Addi... | java | protected Set<Scope> updateProjectInformation(Collector collector) {
long projectDataStart = System.currentTimeMillis();
//Add or update teams that we got from api
Set<Scope> projects = jiraClient.getProjects();
projects.forEach(jiraScope -> {
LOGGER.info(String.format("Addi... | [
"protected",
"Set",
"<",
"Scope",
">",
"updateProjectInformation",
"(",
"Collector",
"collector",
")",
"{",
"long",
"projectDataStart",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"//Add or update teams that we got from api",
"Set",
"<",
"Scope",
">",
"p... | Update project information
@param collector
@return List of projects | [
"Update",
"project",
"information"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L208-L238 |
131,680 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.getBoardList | private List<Team> getBoardList(ObjectId collectorId) {
List<Team> boards;
if(featureSettings.isCollectorItemOnlyUpdate()){
Set<Team> uniqueTeams = new HashSet<>();
for(FeatureBoard featureBoard: enabledFeatureBoards(collectorId)){
Team team = teamRepository.findB... | java | private List<Team> getBoardList(ObjectId collectorId) {
List<Team> boards;
if(featureSettings.isCollectorItemOnlyUpdate()){
Set<Team> uniqueTeams = new HashSet<>();
for(FeatureBoard featureBoard: enabledFeatureBoards(collectorId)){
Team team = teamRepository.findB... | [
"private",
"List",
"<",
"Team",
">",
"getBoardList",
"(",
"ObjectId",
"collectorId",
")",
"{",
"List",
"<",
"Team",
">",
"boards",
";",
"if",
"(",
"featureSettings",
".",
"isCollectorItemOnlyUpdate",
"(",
")",
")",
"{",
"Set",
"<",
"Team",
">",
"uniqueTeam... | Returns a full team list or partial based on whether or not isCollectorItemOnlyUpdate is true
@param collectorId
@return | [
"Returns",
"a",
"full",
"team",
"list",
"or",
"partial",
"based",
"on",
"whether",
"or",
"not",
"isCollectorItemOnlyUpdate",
"is",
"true"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L294-L310 |
131,681 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.getScopeList | private Set<Scope> getScopeList(ObjectId collectorId) {
Set<Scope> projects = new HashSet<>();
if(featureSettings.isCollectorItemOnlyUpdate()){
for(FeatureBoard featureBoard: enabledFeatureBoards(collectorId)){
Scope scope = projectRepository.findByCollectorIdAndPId(collector... | java | private Set<Scope> getScopeList(ObjectId collectorId) {
Set<Scope> projects = new HashSet<>();
if(featureSettings.isCollectorItemOnlyUpdate()){
for(FeatureBoard featureBoard: enabledFeatureBoards(collectorId)){
Scope scope = projectRepository.findByCollectorIdAndPId(collector... | [
"private",
"Set",
"<",
"Scope",
">",
"getScopeList",
"(",
"ObjectId",
"collectorId",
")",
"{",
"Set",
"<",
"Scope",
">",
"projects",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"featureSettings",
".",
"isCollectorItemOnlyUpdate",
"(",
")",
")",
... | Returns a full project list or partial based on whether or not isCollectorItemOnlyUpdate is true
@param collectorId
@return | [
"Returns",
"a",
"full",
"project",
"list",
"or",
"partial",
"based",
"on",
"whether",
"or",
"not",
"isCollectorItemOnlyUpdate",
"is",
"true"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L316-L329 |
131,682 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.saveFeatures | private void saveFeatures(List<Feature> features, FeatureCollector collector) {
features.forEach(f -> {
f.setCollectorId(collector.getId());
Feature existing = featureRepository.findByCollectorIdAndSIdAndSTeamID(collector.getId(), f.getsId(), f.getsTeamID());
if (existing != ... | java | private void saveFeatures(List<Feature> features, FeatureCollector collector) {
features.forEach(f -> {
f.setCollectorId(collector.getId());
Feature existing = featureRepository.findByCollectorIdAndSIdAndSTeamID(collector.getId(), f.getsId(), f.getsTeamID());
if (existing != ... | [
"private",
"void",
"saveFeatures",
"(",
"List",
"<",
"Feature",
">",
"features",
",",
"FeatureCollector",
"collector",
")",
"{",
"features",
".",
"forEach",
"(",
"f",
"->",
"{",
"f",
".",
"setCollectorId",
"(",
"collector",
".",
"getId",
"(",
")",
")",
"... | Save features to repository
@param features
@param collector | [
"Save",
"features",
"to",
"repository"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L341-L350 |
131,683 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.refreshValidIssues | private void refreshValidIssues(FeatureCollector collector, List<Team> teams, Set<Scope> scopes) {
long refreshValidIssuesStart = System.currentTimeMillis();
List<String> lookUpIds = Objects.equals(collector.getMode(), JiraMode.Board) ? teams.stream().map(Team::getTeamId).collect(Collectors.toList()) : ... | java | private void refreshValidIssues(FeatureCollector collector, List<Team> teams, Set<Scope> scopes) {
long refreshValidIssuesStart = System.currentTimeMillis();
List<String> lookUpIds = Objects.equals(collector.getMode(), JiraMode.Board) ? teams.stream().map(Team::getTeamId).collect(Collectors.toList()) : ... | [
"private",
"void",
"refreshValidIssues",
"(",
"FeatureCollector",
"collector",
",",
"List",
"<",
"Team",
">",
"teams",
",",
"Set",
"<",
"Scope",
">",
"scopes",
")",
"{",
"long",
"refreshValidIssuesStart",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",... | Get a list of all issue ids for a given board or project and delete ones that are not in JIRA anymore
@param collector
@param teams
@param scopes | [
"Get",
"a",
"list",
"of",
"all",
"issue",
"ids",
"for",
"a",
"given",
"board",
"or",
"project",
"and",
"delete",
"ones",
"that",
"are",
"not",
"in",
"JIRA",
"anymore"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L377-L391 |
131,684 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java | FeatureCollectorTask.isEpicChanged | private static boolean isEpicChanged(Feature feature, Epic epic) {
if (!feature.getsEpicAssetState().equalsIgnoreCase(epic.getStatus())) {
return true;
}
if (!feature.getsEpicName().equalsIgnoreCase(epic.getName()) || !feature.getsEpicNumber().equalsIgnoreCase(epic.getNumber())) {
... | java | private static boolean isEpicChanged(Feature feature, Epic epic) {
if (!feature.getsEpicAssetState().equalsIgnoreCase(epic.getStatus())) {
return true;
}
if (!feature.getsEpicName().equalsIgnoreCase(epic.getName()) || !feature.getsEpicNumber().equalsIgnoreCase(epic.getNumber())) {
... | [
"private",
"static",
"boolean",
"isEpicChanged",
"(",
"Feature",
"feature",
",",
"Epic",
"epic",
")",
"{",
"if",
"(",
"!",
"feature",
".",
"getsEpicAssetState",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"epic",
".",
"getStatus",
"(",
")",
")",
")",
"{",
"r... | Checks if epic information on a feature needs update | [
"Checks",
"if",
"epic",
"information",
"on",
"a",
"feature",
"needs",
"update"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/collector/FeatureCollectorTask.java#L395-L413 |
131,685 | Hygieia/Hygieia | collectors/feature/jira/src/main/java/com/capitalone/dashboard/utils/Utilities.java | Utilities.parseDateWithoutFraction | public static String parseDateWithoutFraction(String date) {
if(date == null) return "";
if (date.length() < 20) {
return date;
}
return date.substring(0, 19);
} | java | public static String parseDateWithoutFraction(String date) {
if(date == null) return "";
if (date.length() < 20) {
return date;
}
return date.substring(0, 19);
} | [
"public",
"static",
"String",
"parseDateWithoutFraction",
"(",
"String",
"date",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"return",
"\"\"",
";",
"if",
"(",
"date",
".",
"length",
"(",
")",
"<",
"20",
")",
"{",
"return",
"date",
";",
"}",
"retu... | This is weird but way faster than Java date time formatter etc. | [
"This",
"is",
"weird",
"but",
"way",
"faster",
"than",
"Java",
"date",
"time",
"formatter",
"etc",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/feature/jira/src/main/java/com/capitalone/dashboard/utils/Utilities.java#L25-L31 |
131,686 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.buildPipelineResponse | private PipelineResponse buildPipelineResponse(Pipeline pipeline, Long lowerBound, Long upperBound){
/**
* get the collector item and dashboard
*/
CollectorItem dashboardCollectorItem = collectorItemRepository.findOne(pipeline.getCollectorItemId());
Dashboard dashboard = d... | java | private PipelineResponse buildPipelineResponse(Pipeline pipeline, Long lowerBound, Long upperBound){
/**
* get the collector item and dashboard
*/
CollectorItem dashboardCollectorItem = collectorItemRepository.findOne(pipeline.getCollectorItemId());
Dashboard dashboard = d... | [
"private",
"PipelineResponse",
"buildPipelineResponse",
"(",
"Pipeline",
"pipeline",
",",
"Long",
"lowerBound",
",",
"Long",
"upperBound",
")",
"{",
"/**\r\n * get the collector item and dashboard\r\n */",
"CollectorItem",
"dashboardCollectorItem",
"=",
"collector... | Creates the response that is returned to the client | [
"Creates",
"the",
"response",
"that",
"is",
"returned",
"to",
"the",
"client"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L143-L173 |
131,687 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.processCommits | protected void processCommits(Pipeline pipeline, List<Commit> commits) {
// TODO when processing commits should we only add the commits that are within the time boundaries?
Set<String> seenRevisionNumbers = new HashSet<>();
if (logger.isDebugEnabled()) {
StringBuilder sb = new StringBuilder... | java | protected void processCommits(Pipeline pipeline, List<Commit> commits) {
// TODO when processing commits should we only add the commits that are within the time boundaries?
Set<String> seenRevisionNumbers = new HashSet<>();
if (logger.isDebugEnabled()) {
StringBuilder sb = new StringBuilder... | [
"protected",
"void",
"processCommits",
"(",
"Pipeline",
"pipeline",
",",
"List",
"<",
"Commit",
">",
"commits",
")",
"{",
"// TODO when processing commits should we only add the commits that are within the time boundaries?\r",
"Set",
"<",
"String",
">",
"seenRevisionNumbers",
... | Computes the commit stage of the pipeline.
@param pipeline
@param commits | [
"Computes",
"the",
"commit",
"stage",
"of",
"the",
"pipeline",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L245-L266 |
131,688 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.getComponentRepoBranch | protected RepoBranch getComponentRepoBranch(Component component) {
CollectorItem item = component.getFirstCollectorItemForType(CollectorType.SCM);
if (item == null) {
logger.warn("Error encountered building pipeline: could not find scm collector item for dashboard.");
return new Re... | java | protected RepoBranch getComponentRepoBranch(Component component) {
CollectorItem item = component.getFirstCollectorItemForType(CollectorType.SCM);
if (item == null) {
logger.warn("Error encountered building pipeline: could not find scm collector item for dashboard.");
return new Re... | [
"protected",
"RepoBranch",
"getComponentRepoBranch",
"(",
"Component",
"component",
")",
"{",
"CollectorItem",
"item",
"=",
"component",
".",
"getFirstCollectorItemForType",
"(",
"CollectorType",
".",
"SCM",
")",
";",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"... | Determine the SCM url and branch that is set for the component. Information
is gathered with the assumption that the data is stored in options.url and
options.branch.
@param component
@return the {@link RepoBranch} that the component uses | [
"Determine",
"the",
"SCM",
"url",
"and",
"branch",
"that",
"is",
"set",
"for",
"the",
"component",
".",
"Information",
"is",
"gathered",
"with",
"the",
"assumption",
"that",
"the",
"data",
"is",
"stored",
"in",
"options",
".",
"url",
"and",
"options",
".",... | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L635-L647 |
131,689 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.getArtifactIdentifiers | private Map<Environment, Collection<ArtifactIdentifier>> getArtifactIdentifiers(List<Environment> environments) {
Map<Environment, Collection<ArtifactIdentifier>> rt = new HashMap<>();
for (Environment env : environments) {
Set<ArtifactIdentifier> ids = new HashSet<>();
if (env.getUnits() != null... | java | private Map<Environment, Collection<ArtifactIdentifier>> getArtifactIdentifiers(List<Environment> environments) {
Map<Environment, Collection<ArtifactIdentifier>> rt = new HashMap<>();
for (Environment env : environments) {
Set<ArtifactIdentifier> ids = new HashSet<>();
if (env.getUnits() != null... | [
"private",
"Map",
"<",
"Environment",
",",
"Collection",
"<",
"ArtifactIdentifier",
">",
">",
"getArtifactIdentifiers",
"(",
"List",
"<",
"Environment",
">",
"environments",
")",
"{",
"Map",
"<",
"Environment",
",",
"Collection",
"<",
"ArtifactIdentifier",
">",
... | this is here for future expansion | [
"this",
"is",
"here",
"for",
"future",
"expansion"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L686-L714 |
131,690 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.buildCommitGraph | private Map<String, Collection<String>> buildCommitGraph(List<Commit> commits) {
// multimap api doesn't quite fit what we want to do here
Map<String, Collection<String>> rt = new HashMap<>();
// TODO build graph for svn
for (Commit commit : commits) {
String revisionNumber = commit.getScmRevisi... | java | private Map<String, Collection<String>> buildCommitGraph(List<Commit> commits) {
// multimap api doesn't quite fit what we want to do here
Map<String, Collection<String>> rt = new HashMap<>();
// TODO build graph for svn
for (Commit commit : commits) {
String revisionNumber = commit.getScmRevisi... | [
"private",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"buildCommitGraph",
"(",
"List",
"<",
"Commit",
">",
"commits",
")",
"{",
"// multimap api doesn't quite fit what we want to do here\r",
"Map",
"<",
"String",
",",
"Collection",
"<",
"Str... | We assume each commit belongs to the same repo + branch | [
"We",
"assume",
"each",
"commit",
"belongs",
"to",
"the",
"same",
"repo",
"+",
"branch"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L794-L817 |
131,691 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.applyStageTimestamps | private PipelineResponseCommit applyStageTimestamps(PipelineResponseCommit commit, Dashboard dashboard, Pipeline pipeline,List<PipelineStage> pipelineStageList){
PipelineResponseCommit returnCommit = new PipelineResponseCommit(commit);
for(PipelineStage systemStage : pipelineStageList) {
... | java | private PipelineResponseCommit applyStageTimestamps(PipelineResponseCommit commit, Dashboard dashboard, Pipeline pipeline,List<PipelineStage> pipelineStageList){
PipelineResponseCommit returnCommit = new PipelineResponseCommit(commit);
for(PipelineStage systemStage : pipelineStageList) {
... | [
"private",
"PipelineResponseCommit",
"applyStageTimestamps",
"(",
"PipelineResponseCommit",
"commit",
",",
"Dashboard",
"dashboard",
",",
"Pipeline",
"pipeline",
",",
"List",
"<",
"PipelineStage",
">",
"pipelineStageList",
")",
"{",
"PipelineResponseCommit",
"returnCommit",... | For a given commit, will traverse the pipeline and find the time it entered in each stage of the pipeline
@param commit
@param dashboard
@param pipeline
@return | [
"For",
"a",
"given",
"commit",
"will",
"traverse",
"the",
"pipeline",
"and",
"find",
"the",
"time",
"it",
"entered",
"in",
"each",
"stage",
"of",
"the",
"pipeline"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L873-L888 |
131,692 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.findCommitsForStage | private Map<String, PipelineCommit> findCommitsForStage(Dashboard dashboard, Pipeline pipeline, PipelineStage stage) {
Map<String, PipelineCommit> commitMap = new HashMap<>();
// The environment name including the pseudo environments "Build" and "Commit"
String psuedoEnvironmentName =
... | java | private Map<String, PipelineCommit> findCommitsForStage(Dashboard dashboard, Pipeline pipeline, PipelineStage stage) {
Map<String, PipelineCommit> commitMap = new HashMap<>();
// The environment name including the pseudo environments "Build" and "Commit"
String psuedoEnvironmentName =
... | [
"private",
"Map",
"<",
"String",
",",
"PipelineCommit",
">",
"findCommitsForStage",
"(",
"Dashboard",
"dashboard",
",",
"Pipeline",
"pipeline",
",",
"PipelineStage",
"stage",
")",
"{",
"Map",
"<",
"String",
",",
"PipelineCommit",
">",
"commitMap",
"=",
"new",
... | Gets all commits for a given pipeline stage, taking into account the mappings for environment stages
@param dashboard
@param pipeline
@param stageType
@return | [
"Gets",
"all",
"commits",
"for",
"a",
"given",
"pipeline",
"stage",
"taking",
"into",
"account",
"the",
"mappings",
"for",
"environment",
"stages"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L897-L909 |
131,693 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java | DynamicPipelineServiceImpl.findNotPropagatedCommits | public List<PipelineResponseCommit> findNotPropagatedCommits(Dashboard dashboard, Pipeline pipeline, PipelineStage stage,List<PipelineStage> pipelineStageList){
Map<String, PipelineCommit> startingStage = findCommitsForStage(dashboard, pipeline, stage);
List<PipelineResponseCommit> notPropagatedComm... | java | public List<PipelineResponseCommit> findNotPropagatedCommits(Dashboard dashboard, Pipeline pipeline, PipelineStage stage,List<PipelineStage> pipelineStageList){
Map<String, PipelineCommit> startingStage = findCommitsForStage(dashboard, pipeline, stage);
List<PipelineResponseCommit> notPropagatedComm... | [
"public",
"List",
"<",
"PipelineResponseCommit",
">",
"findNotPropagatedCommits",
"(",
"Dashboard",
"dashboard",
",",
"Pipeline",
"pipeline",
",",
"PipelineStage",
"stage",
",",
"List",
"<",
"PipelineStage",
">",
"pipelineStageList",
")",
"{",
"Map",
"<",
"String",
... | get the commits for a given stage by finding which commits havent passed to a later stage
@param dashboard dashboard
@param pipeline pipeline for that dashboard
@param stage current stage
@return a list of all commits as pipeline response commits that havent moved past the current stage | [
"get",
"the",
"commits",
"for",
"a",
"given",
"stage",
"by",
"finding",
"which",
"commits",
"havent",
"passed",
"to",
"a",
"later",
"stage"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/service/DynamicPipelineServiceImpl.java#L918-L927 |
131,694 | Hygieia/Hygieia | collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorTask.java | AuditCollectorTask.getAuditResults | protected List<AuditResult> getAuditResults(Iterable<Dashboard> dashboards) {
int numberOfAuditDays = settings.getDays();
long auditBeginDateTimeStamp = Instant.now().minus(Duration.ofDays(numberOfAuditDays)).toEpochMilli();
long auditEndDateTimeStamp = Instant.now().toEpochMilli();
LOGG... | java | protected List<AuditResult> getAuditResults(Iterable<Dashboard> dashboards) {
int numberOfAuditDays = settings.getDays();
long auditBeginDateTimeStamp = Instant.now().minus(Duration.ofDays(numberOfAuditDays)).toEpochMilli();
long auditEndDateTimeStamp = Instant.now().toEpochMilli();
LOGG... | [
"protected",
"List",
"<",
"AuditResult",
">",
"getAuditResults",
"(",
"Iterable",
"<",
"Dashboard",
">",
"dashboards",
")",
"{",
"int",
"numberOfAuditDays",
"=",
"settings",
".",
"getDays",
"(",
")",
";",
"long",
"auditBeginDateTimeStamp",
"=",
"Instant",
".",
... | Get audit statuses for the dashboards
@param dashboards | [
"Get",
"audit",
"statuses",
"for",
"the",
"dashboards"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/audit/nfrr/src/main/java/com/capitalone/dashboard/collector/AuditCollectorTask.java#L82-L96 |
131,695 | Hygieia/Hygieia | collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/AWSCloudCollectorTask.java | AWSCloudCollectorTask.collect | public void collect(AWSCloudCollector collector) {
log("Starting AWS collection...");
log("Collecting AWS Cloud Data...");
Map<String, List<CloudInstance>> accountToInstanceMap = collectInstances();
Map<String, String> instanceToAccountMap = new HashMap<>();
for (String account... | java | public void collect(AWSCloudCollector collector) {
log("Starting AWS collection...");
log("Collecting AWS Cloud Data...");
Map<String, List<CloudInstance>> accountToInstanceMap = collectInstances();
Map<String, String> instanceToAccountMap = new HashMap<>();
for (String account... | [
"public",
"void",
"collect",
"(",
"AWSCloudCollector",
"collector",
")",
"{",
"log",
"(",
"\"Starting AWS collection...\"",
")",
";",
"log",
"(",
"\"Collecting AWS Cloud Data...\"",
")",
";",
"Map",
"<",
"String",
",",
"List",
"<",
"CloudInstance",
">",
">",
"ac... | The collection action. This is the task which will run on a schedule to
gather data from the feature content source system and update the
repository with retrieved . | [
"The",
"collection",
"action",
".",
"This",
"is",
"the",
"task",
"which",
"will",
"run",
"on",
"a",
"schedule",
"to",
"gather",
"data",
"from",
"the",
"feature",
"content",
"source",
"system",
"and",
"update",
"the",
"repository",
"with",
"retrieved",
"."
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/AWSCloudCollectorTask.java#L118-L134 |
131,696 | Hygieia/Hygieia | api-audit/src/main/java/com/capitalone/dashboard/evaluator/BuildEvaluator.java | BuildEvaluator.getBuildJobAuditResponse | private BuildAuditResponse getBuildJobAuditResponse(CollectorItem buildItem, long beginDate, long endDate, List<CollectorItem> repoItems) {
BuildAuditResponse buildAuditResponse = new BuildAuditResponse();
List<CollectorItemConfigHistory> jobConfigHists = collItemConfigHistoryRepository.findByCollecto... | java | private BuildAuditResponse getBuildJobAuditResponse(CollectorItem buildItem, long beginDate, long endDate, List<CollectorItem> repoItems) {
BuildAuditResponse buildAuditResponse = new BuildAuditResponse();
List<CollectorItemConfigHistory> jobConfigHists = collItemConfigHistoryRepository.findByCollecto... | [
"private",
"BuildAuditResponse",
"getBuildJobAuditResponse",
"(",
"CollectorItem",
"buildItem",
",",
"long",
"beginDate",
",",
"long",
"endDate",
",",
"List",
"<",
"CollectorItem",
">",
"repoItems",
")",
"{",
"BuildAuditResponse",
"buildAuditResponse",
"=",
"new",
"Bu... | Calculates Audit Response for a given dashboard
@param beginDate
@param endDate
@return BuildAuditResponse for the build job for a given dashboard, begin and end date | [
"Calculates",
"Audit",
"Response",
"for",
"a",
"given",
"dashboard"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api-audit/src/main/java/com/capitalone/dashboard/evaluator/BuildEvaluator.java#L112-L142 |
131,697 | Hygieia/Hygieia | collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/AWSCloudCollector.java | AWSCloudCollector.prototype | public static AWSCloudCollector prototype() {
AWSCloudCollector protoType = new AWSCloudCollector();
protoType.setName("AWSCloud");
protoType.setOnline(true);
protoType.setEnabled(true);
protoType.setCollectorType(CollectorType.Cloud);
protoType.setLastExecuted(System.currentTimeMillis());
return p... | java | public static AWSCloudCollector prototype() {
AWSCloudCollector protoType = new AWSCloudCollector();
protoType.setName("AWSCloud");
protoType.setOnline(true);
protoType.setEnabled(true);
protoType.setCollectorType(CollectorType.Cloud);
protoType.setLastExecuted(System.currentTimeMillis());
return p... | [
"public",
"static",
"AWSCloudCollector",
"prototype",
"(",
")",
"{",
"AWSCloudCollector",
"protoType",
"=",
"new",
"AWSCloudCollector",
"(",
")",
";",
"protoType",
".",
"setName",
"(",
"\"AWSCloud\"",
")",
";",
"protoType",
".",
"setOnline",
"(",
"true",
")",
... | Creates a static prototype of the Cloud Collector, which includes any
specific settings or configuration required for the use of this
collector, including settings for connecting to any source systems.
@return A configured Cloud Collector prototype | [
"Creates",
"a",
"static",
"prototype",
"of",
"the",
"Cloud",
"Collector",
"which",
"includes",
"any",
"specific",
"settings",
"or",
"configuration",
"required",
"for",
"the",
"use",
"of",
"this",
"collector",
"including",
"settings",
"for",
"connecting",
"to",
"... | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/cloud/aws/src/main/java/com/capitalone/dashboard/collector/AWSCloudCollector.java#L36-L45 |
131,698 | Hygieia/Hygieia | api/src/main/java/com/capitalone/dashboard/rest/FeatureController.java | FeatureController.featureAggregatedSprintEstimates | @RequestMapping(value = "/feature/estimates/aggregatedsprints", method = GET, produces = APPLICATION_JSON_VALUE)
public DataResponse<SprintEstimate> featureAggregatedSprintEstimates (
@RequestParam(value = "projectId", required = true) String projectId,
@RequestParam(value = "agileType", required = false) ... | java | @RequestMapping(value = "/feature/estimates/aggregatedsprints", method = GET, produces = APPLICATION_JSON_VALUE)
public DataResponse<SprintEstimate> featureAggregatedSprintEstimates (
@RequestParam(value = "projectId", required = true) String projectId,
@RequestParam(value = "agileType", required = false) ... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/feature/estimates/aggregatedsprints\"",
",",
"method",
"=",
"GET",
",",
"produces",
"=",
"APPLICATION_JSON_VALUE",
")",
"public",
"DataResponse",
"<",
"SprintEstimate",
">",
"featureAggregatedSprintEstimates",
"(",
"@",
"Req... | REST endpoint for retrieving the current sprint estimates for a team
@param teamId
A given scope-owner's source-system ID
@return | [
"REST",
"endpoint",
"for",
"retrieving",
"the",
"current",
"sprint",
"estimates",
"for",
"a",
"team"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api/src/main/java/com/capitalone/dashboard/rest/FeatureController.java#L118-L127 |
131,699 | Hygieia/Hygieia | api-audit/src/main/java/com/capitalone/dashboard/service/CodeReviewAuditServiceImpl.java | CodeReviewAuditServiceImpl.getPeerReviewResponses | @Override
public Collection<CodeReviewAuditResponse> getPeerReviewResponses(String repoUrl, String repoBranch, String scmName,
long beginDt, long endDt) {
Collector githubCollector = collectorRepository.findByName(!StringUtils.isEmpty(scm... | java | @Override
public Collection<CodeReviewAuditResponse> getPeerReviewResponses(String repoUrl, String repoBranch, String scmName,
long beginDt, long endDt) {
Collector githubCollector = collectorRepository.findByName(!StringUtils.isEmpty(scm... | [
"@",
"Override",
"public",
"Collection",
"<",
"CodeReviewAuditResponse",
">",
"getPeerReviewResponses",
"(",
"String",
"repoUrl",
",",
"String",
"repoBranch",
",",
"String",
"scmName",
",",
"long",
"beginDt",
",",
"long",
"endDt",
")",
"{",
"Collector",
"githubCol... | Calculates peer review response
@param repoUrl
@param repoBranch
@param scmName
@param beginDt
@param endDt
@return | [
"Calculates",
"peer",
"review",
"response"
] | d8b67a590da2744acf59bcd99d9b34ef1bb84890 | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/api-audit/src/main/java/com/capitalone/dashboard/service/CodeReviewAuditServiceImpl.java#L53-L78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.