Showing 71 of 183 total issues
Function open
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
async open() {
if (!this.view.editable) {
return;
}
Function view
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
get view() {
const handler = this.handler;
return Vue.extend({
components: {
TermiEditor,
- 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 rakenneNodecolor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function rakenneNodecolor(node, parentMandatory, el) {
const isRyhma = !!node.rooli;
if (isRyhma) {
const mapped = RooliToTheme[node.rooli];
- 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 start
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async start() {
this.state.disabled = true;
this.state.isLoading = true;
// Ei editointia uudestaan
Function view
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
get view() {
const linkkiHandler = this.linkkiHandler;
return Vue.extend({
components: {
},
Function createRestangular
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const createRestangular = (
scope,
field: string,
resolvedObj: Restangular.IElement,
callbacks: IEditointikontrollitCallbacks = {}) => {
- 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 install
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public install(vue: typeof Vue) {
function aikaleimaFnFactory(this: void, format: string) {
const self: any = this;
return function(this: void, value: number) {
if (!Kielet.i18n.locale) {
Function controller
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const controller = ($scope, $rootScope, $timeout) => {
$scope.toggleHistoryModal = () => {
if ($scope.$$showingHistoryModal) {
HistoryModal.hide();
}
Function install
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static install(vue: typeof Vue) {
if (!vue.prototype.$notify) {
throw new Error('Vue.use(require("vue-notification"))');
}
Function resolveRouterMetaProps
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function resolveRouterMetaProps(to) {
let props = {};
try {
for (const record of to.matched) {
Function setPerusteData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function setPerusteData(node: NavigationNode, rawNode: NavigationNodeDto) {
switch (rawNode.type as string) {
case 'viite':
case 'taiteenala':
case 'liite':
- 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 dateformatvalidator
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const dateformatvalidator = () => {
return {
restrict: "A",
require: "ngModel",
Function kaanna
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public kaanna(value?: LokalisoituTeksti | undefined | null, emptyWhenNotFound = false, squareBrackets = true, forcedLang = null): string {
if (!value) {
return '';
}
else if (_.isObject(value)) {
Function link
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: (scope, element, attrs) => {
scope.type = scope.type || "text";
attrs.$observe("required", (value) => {
if (value === "required" || value === "true" || value === "") {
Function setup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setup() {
element.find(TERMI_MATCHER).each(function () {
var jqEl: any = angular.element(this);
var viiteId: any = jqEl.attr('data-viite');
TermistoData.getByAvain(viiteId, $stateParams.ktId).then(function(res) {
Function mockEditointiStore
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function mockEditointiStore<T>(config: Partial<IEditoitava> = {}) {
const editointi = {
acquire: jest.fn(async () => {
const vanhentuu = new Date();
vanhentuu.setMinutes(vanhentuu.getMinutes() + 10);
Function dateformatvalidator
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const dateformatvalidator = () => {
return {
restrict: "A",
require: "ngModel",
- 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 getLaajaAlaisetKoodit
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getLaajaAlaisetKoodit() {
return [{
koodi: 'lops2019laajaalainenosaaminen_1',
nimi: {
fi: 'Globaali- ja kulttuuriosaaminen',
Function start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: () => _$q((resolve, reject) => {
const editoi = (osa) => {
_.assign(resolvedObj, osa);
backup = _.cloneDeep(resolvedObj);
scope[field] = _.clone(resolvedObj);
Function link
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: (scope, el, attrs) => {
const kaannaValue = (value) => _.isObject(value)
? KaannaService.kaannaSisalto(value)
: KaannaService.kaanna(value);
const original = getAttr(attrs["kaanna"], scope) || el.text();