Showing 100 of 340 total issues
Function getSearchCondition
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSearchCondition() {
const withUser = true;
this.searchConditionService.get({
userId: this.auth.loginUser._id.toString()
Function intercept
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const token = this.localStorageService.get(LOCALSTORAGE_KEY.TOKEN);
const req = request.clone(token
? { headers: request.headers.set('x-access-token', token)}
: { headers: request.headers }
Function createCondition
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
createCondition(): SearchArticlesCondition {
const noCondition = {};
if (!this.seaerchConditions
|| this.seaerchConditions.length === 0) {
Function upsert
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
upsert() {
const searchCondition: any = {};
searchCondition.name = this.form.value.name;
searchCondition.author = this.auth.loginUser._id;
searchCondition.users = this.form.value.users;
Function sortAndRefresh
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
sortAndRefresh(selectedKey): void {
for (const key of this.sortFactorKeys) {
const factor = this.sortFactors[key];
if (selectedKey === key) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function deleteCondition
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
deleteCondition(conditionForDelete: SearchConditionModel) {
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
data: {
title: '検索条件削除',
message: `「${conditionForDelete.name}」を削除しますか?`
Function adjustIndent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private adjustIndent($event) {
const TAB = ' ';
// インデントを追加
if (!$event.shiftKey) {
if (this.extractListInfo().isListLine) {
Function constructSearchCondition
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private constructSearchCondition(cb: (searchCondition: SearchArticlesCondition) => void ): void {
switch (this.mode) {
case ArticleSearchMode.ALL:
cb({});
break;
Function getCondition
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getCondition(req: any, cb: Function): void {
const query = req.query;
const source = query.condition ?
JSON.parse(query.condition) :
{};
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onValidationError
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private onValidationError(error: any): void {
const noControlErrors = [];
for (const e of error['errors']) {
// getterからformControllを取得
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function upsertArticle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
upsertArticle(form: FormGroup): void {
if (!form.valid ) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function constructCondition
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function constructCondition(req: any, cb: Function): void {
const query = req.query;
const source = query.condition ?
JSON.parse(query.condition) :
{};
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onValidationError
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private onValidationError(error: any): void {
const noControlErrors = [];
for (const e of error['errors']) {
const control: FormControl | FormGroup = this[e.param];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function createCondition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
createCondition(): SearchArticlesCondition {
const noCondition = {};
if (!this.seaerchConditions
|| this.seaerchConditions.length === 0) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getImage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getImage(req, res, next, condition: any, errorMessage: string) {
Function onValidationError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onValidationError(error: any): void {
const noControlErrors = [];
for (const e of error['errors']) {
// getterからformControllを取得
const control: FormControl | FormGroup = this[e.param];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onDrop
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@HostListener('drop', ['$event']) public onDrop(evt) {
evt.preventDefault();
evt.stopPropagation();
this.dragover = false;
const files = evt.dataTransfer.files;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onValidationError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private onValidationError(error: any): void {
const noControlErrors = [];
for (const e of error['errors']) {
const control: FormControl | FormGroup = this[e.param];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function onValidationError
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onValidationError(error: any): void {
const noControlErrors = [];
for (const e of error['errors']) {
// getterからformControllを取得
const control: FormControl | FormGroup = this[e.param];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function textFormat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
textFormat($event) {
if ($event.keyCode === 9) {
$event.preventDefault();
this.adjustIndent($event);
return;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"