Showing 183 of 183 total issues
File NavigationBuilder.ts
has 775 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { NavigationNodeDto, LokalisoituTekstiDto } from '../tyypit';
import _ from 'lodash';
import { Kielet } from '../stores/kieli';
import { Location } from 'vue-router';
Function setPerusteData
has 307 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setPerusteData(node: NavigationNode, rawNode: NavigationNodeDto) {
switch (rawNode.type as string) {
case 'viite':
case 'taiteenala':
case 'liite':
Function setOpetussuunnitelmaData
has 271 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setOpetussuunnitelmaData(node: NavigationNode, rawNode: NavigationNodeDto) {
switch (rawNode.type as string) {
case 'viite':
case 'liite':
// Route linkki
File perusteet.ts
has 562 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Koulutustyyppi, KoulutustyyppiToteutus } from '@shared/tyypit';
import _ from 'lodash';
export const KoodistoLops2019LaajaAlaiset = 'laajaalainenosaaminenlops2021';
Function link
has 212 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: (scope: any, element, attrs, ctrl) => {
let placeholderText = null;
let editingEnabled = (scope.editMode || "true") === "true";
let inlineEditor: boolean = true;
File EditointiStore.ts
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as _ from 'lodash';
import Vue from 'vue';
import VueScrollTo from 'vue-scrollto';
import { reactive, computed } from '@vue/composition-api';
import { Computed } from '../../utils/interfaces';
Function view
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
get view() {
const opsId = this.opsId;
const self = this;
return Vue.extend({
components: {
File eperusteet.ts
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { axiosHandler, successfulResponseHandler } from './common';
import { Configuration, DokumentitApiAxiosParamCreator, LiitetiedostotApiAxiosParamCreator } from '../generated/eperusteet';
import axios, { AxiosInstance } from 'axios';
import _ from 'lodash';
import * as EperusteetApi from '../generated/eperusteet';
EditointiStore
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
export class EditointiStore {
private static allEditingEditors: EditointiStore[] = [];
private static router: VueRouter;
private static kayttajaProvider: KayttajaProvider;
private logger = createLogger(EditointiStore);
Function controller
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ($scope, $timeout, $rootScope) => {
$scope.versions = [];
const cleanTeksti = (richText: string): string => {
let result = richText;
File ckeditor.ts
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
angular.module("app")
.run(() => {
CKEDITOR.disableAutoInline = true;
})
.constant("editorLayouts", {
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const themes = {
'koulutustyyppi_1': 'ammatillinen',
'koulutustyyppi_11': 'ammatillinen',
'koulutustyyppi_12': 'ammatillinen',
'koulutustyyppi_5': 'ammatillinen',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 111.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const ktToState = {
'koulutustyyppi_1': 'ammatillinenperustutkinto',
'koulutustyyppi_11': 'ammattitutkinto',
'koulutustyyppi_12': 'erikoisammattitutkinto',
'koulutustyyppi_14': 'aikuistenlukiokoulutus',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 111.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function view
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
get view() {
const handler = this.handler;
return Vue.extend({
components: {
TermiEditor,
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isModeDark) {
logger.info('Set dark mode');
_.each(links, link => {
if (link.hasAttribute('href') && _.includes(link.getAttribute('href'), 'favicon')) {
const href = _.replace(link.getAttribute('href')!, 'favicon', 'favicon-inverted');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 107.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
else {
logger.info('Set light mode');
_.each(links, link => {
if (link.hasAttribute('href') && _.includes(link.getAttribute('href'), 'favicon')) {
const href = _.replace(link.getAttribute('href')!, 'favicon-inverted', 'favicon');
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 107.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function resolveRouterMetaProps
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export async function resolveRouterMetaProps(to) {
let props = {};
try {
for (const record of to.matched) {
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
export async function findTiedotteetBy(query: TiedotteetQuery) {
return Tiedotteet.findTiedotteetBy(
query.sivu,
query.sivukoko,
query.kieli,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 98.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export async function getJulkisetOpetussuunnitelmat(query: OpetussuunnitelmaQuery) {
return JulkinenApi.findOpetussuunnitelmatJulkaisut(
query.perusteenDiaarinumero,
query.perusteId,
query.organisaatio,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 98.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
case 'perusopetusoppiaine':
node.location = {
name: _.get(rawNode, 'meta.vlkId') ? 'opetussuunnitelmaperusopetusvuosiluokanoppiaine' : 'opetussuunnitelmaperusopetusoppiaine',
params: {
oppiaineId: _.toString(rawNode.id),
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 96.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76