Showing 71 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", {
Function view
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
get view() {
const handler = this.handler;
return Vue.extend({
components: {
TermiEditor,
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
Function iterateTunnisteelliset
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export const iterateTunnisteelliset = (obj: Object, cb: (tunniste: string, obj) => boolean | void) => {
const cache = {}; // Cycle detection
const stack = [obj]; // Recursion elimination
while (stack.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
File editointikontrollit.ts
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
interface IEditointikontrollitCallbacks {
start?: (val?) => Promise<any>,
preStart?: () => Promise<any>,
preSave?: () => Promise<any>,
save?: (kommentti?, preSavedObject?) => Promise<any>,
Function link
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope: any, element) {
scope.popovers = [];
function destroy() {
element.find(TERMI_MATCHER).each(function () {
Function createRestangular
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createRestangular = (
scope,
field: string,
resolvedObj: Restangular.IElement,
callbacks: IEditointikontrollitCallbacks = {}) => {
Function directive
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const directive = ($parse, $timeout) => {
const checkInputType = (scope) => {
scope.datePicker = {
Function view
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
get view() {
const opsId = this.opsId;
const self = this;
return Vue.extend({
components: {
- 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 kaanna
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public kaanna(value?: LokalisoituTeksti | undefined | null, emptyWhenNotFound = false, squareBrackets = true, forcedLang = null): string {
if (!value) {
return '';
}
else if (_.isObject(value)) {
- 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"