Showing 1,533 of 3,645 total issues
Function CreateIngressView
has 723 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function CreateIngressView() {
const environmentId = useEnvironmentId();
const { params } = useCurrentStateAndParams();
const { authorized: isAuthorizedToAddEdit } = useAuthorizations([
'K8sIngressesW',
File portainer.go
has 1422 lines of code (exceeds 500 allowed). Consider refactoring. Open
package portainer
import (
"context"
"fmt"
File createApplicationController.js
has 960 lines of code (exceeds 250 allowed). Consider refactoring. Open
import angular from 'angular';
import _ from 'lodash-es';
import filesizeParser from 'filesize-parser';
import * as JsonPatch from 'fast-json-patch';
import { RegistryTypes } from '@/portainer/models/registryTypes';
Function StackServiceFactory
has 400 lines of code (exceeds 25 allowed). Consider refactoring. Open
function StackServiceFactory($q, $async, Stack, StackByName, FileUploadService, StackHelper, ServiceService, ContainerService, SwarmService) {
'use strict';
var service = {
updateGit,
updateKubeGit,
File serviceController.js
has 792 lines of code (exceeds 250 allowed). Consider refactoring. Open
require('./includes/configs.html');
require('./includes/constraints.html');
require('./includes/container-specs.html');
require('./includes/containerlabels.html');
require('./includes/environmentvariables.html');
File IngressForm.tsx
has 767 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ChangeEvent, useEffect } from 'react';
import { Plus, RefreshCw, Trash2 } from 'lucide-react';
import Route from '@/assets/ico/route.svg?c';
File CreateIngressView.tsx
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useState, useEffect, useMemo, useCallback, ReactNode } from 'react';
import { useCurrentStateAndParams, useRouter } from '@uirouter/react';
import { v4 as uuidv4 } from 'uuid';
import { debounce } from 'lodash';
Method Store.Export
has a Cognitive Complexity of 98 (exceeds 20 allowed). Consider refactoring. Open
func (store *Store) Export(filename string) (err error) {
backup := storeExport{}
if c, err := store.CustomTemplate().ReadAll(); err != nil {
if !store.IsErrObjectNotFound(err) {
- 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 SettingsAuthenticationController
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
function SettingsAuthenticationController($q, $scope, $state, Notifications, SettingsService, FileUploadService, TeamService, LDAPService) {
$scope.authMethod = 1;
$scope.state = {
uploadInProgress: false,
- 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 EndpointController
has 292 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EndpointController(
$async,
$scope,
$state,
$transition$,
Function CreateIngressView
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
export function CreateIngressView() {
const environmentId = useEnvironmentId();
const { params } = useCurrentStateAndParams();
const { authorized: isAuthorizedToAddEdit } = useAuthorizations([
'K8sIngressesW',
- 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 __module.js
has 630 lines of code (exceeds 250 allowed). Consider refactoring. Open
import angular from 'angular';
import { PortainerEndpointTypes } from 'Portainer/models/endpoint/models';
import { EnvironmentStatus } from '@/react/portainer/environments/types';
KubernetesCreateApplicationController
has 73 functions (exceeds 20 allowed). Consider refactoring. Open
class KubernetesCreateApplicationController {
/* #region CONSTRUCTOR */
/* @ngInject */
constructor(
Function ApplicationSummaryWidget
has 267 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ApplicationSummaryWidget() {
const stateAndParams = useCurrentStateAndParams();
const {
params: {
namespace,
File __module.js
has 598 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { EnvironmentStatus } from '@/react/portainer/environments/types';
import { updateAxiosAdapter } from '@/portainer/services/axios';
import { PortainerEndpointTypes } from 'Portainer/models/endpoint/models';
import { CACHE_REFRESH_EVENT, CACHE_DURATION } from '../portainer/services/http-request.helper';
Function ChartService
has 241 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ChartService() {
'use strict';
// Max. number of items to display on a chart
var CHART_LIMIT = 600;
File createServiceController.js
has 560 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash-es';
import * as envVarsUtils from '@/react/components/form-components/EnvironmentVariablesFieldset/utils';
import { PorImageRegistryModel } from 'Docker/models/porImageRegistry';
import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel';
Function kubeServicesValidation
has 232 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function kubeServicesValidation(
validationData?: AppServicesValidationData
): SchemaOf<ServiceFormValues[]> {
return array(
object({
Method Handler.endpointUpdate
has a Cognitive Complexity of 73 (exceeds 20 allowed). Consider refactoring. Open
func (handler *Handler) endpointUpdate(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id")
if err != nil {
return httperror.BadRequest("Invalid environment identifier route variable", err)
}
- 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 EndpointController
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
function EndpointController(
$async,
$scope,
$state,
$transition$,
- 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"