Showing 16 of 27 total issues
Function searchBook
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
async searchBook(isbn: string) {
const loader = this.loadingCtrl.create({
content: '検索中です…'
});
loader.present();
Function constructor
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
private navParams: NavParams,
private loadingCtrl: LoadingController,
protected viewCtrl: ViewController,
protected toastCtrl: ToastController,
Function createPlan
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
createPlan() {
this.alertCtrl
.create({
title: '読書計画の追加',
message: '計画のタイトルと説明文を入力してください',
Function ionViewDidLoad
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
ionViewDidLoad() {
this.store.dispatch(new WatchSkill());
this.skills$ = this.store.pipe(
select(getSkills),
map(skills => {
Function searchBookListener
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
searchBookListener() {
this.alertCtrl
.create({
title: 'ISBN で本を検索',
inputs: [
Function update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
async update() {
if (this.valid === false) return;
let count = parseInt(this.pageCount, 10);
if (count < 0) count = 0;
if (count > this.plan.book.pageCount) {
Function createSkillListener
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
createSkillListener() {
this.alertCtrl
.create({
title: 'スキルの追加',
inputs: [
Function ngAfterViewInit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngAfterViewInit() {
const context = this.graph.nativeElement.getContext('2d');
new Chart(context, {
type: 'doughnut',
data: {
Function adjustThumbnails
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
adjustThumbnails() {
const firstThumbnail = document.getElementsByClassName('book-thumbnail')[0];
if (firstThumbnail === void 0) return;
const booksRow = document.getElementById('books-row'),
Function skills$
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
map(skills => {
this.labels = [];
this.data = [];
let sum = 0;
const dateWithSum = {};
Function sortFn
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const sortFn = (fieldName: string, order: Order) => (
former,
latter
): number => {
const asc = order === 'asc',
- 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 searchBook
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async searchBook(isbn: string) {
const loader = this.loadingCtrl.create({
content: '検索中です…'
});
loader.present();
- 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 ionViewDidLoad
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ionViewDidLoad() {
this.store.dispatch(new WatchSkill());
this.skills$ = this.store.pipe(
select(getSkills),
map(skills => {
- 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 _deleteSkill
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const _deleteSkill = (db: FirebaseFirestore.Firestore) => async (args: {
isbn: string;
content: string;
uid: string;
}) => {
- 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 _unregisterBook
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const _unregisterBook = (
db: FirebaseFirestore.Firestore
) => async (args: { isbn: string; uid: string }): Promise<boolean> => {
try {
const querySnapshots = (await db
- 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 withdraw
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async ({ uid }: { uid: string }) => {
await admin.auth().deleteUser(uid);
const collections = ['bookshelf', 'plans', 'skills'];
const firestore = admin.firestore();
for (const collection of collections) {
- 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"