Showing 25 of 49 total issues
Function baseConfig
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function baseConfig(coverage = true): ViteConfig {
const config = {
plugins: [
vue(),
VitePWA({
Function parseFile
has 76 lines of code (exceeds 50 allowed). Consider refactoring. Open
func parseFile(file io.Reader) {
reader := bufio.NewReader(file)
firstLine, err := reader.ReadString('\n')
logger.PanicErr(logger.Database, err, "")
Function storeObj
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected storeObj(
fetchedObj: FetchedObjStatic<T, FO>,
cacheStorage: CacheStorageStatic<T, CS>,
key: string,
value: 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 getRoute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getRoute(path: string, name: string, component: string): string {
let metaTxt = "";
for (const key of Object.keys(meta)) {
if (
meta[key].includes(name) ||
Function updateDay
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func updateDay(
updatedDay *wings.Day, createOnNonExist bool,
) bool {
existingDay := fetchDay(int64(updatedDay.ID))
if updatedDay.ID == -1 || existingDay.ID != updatedDay.ID {
Function genScreenShot
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function genScreenShot(
config: AltimeterConfig,
browser: Browser,
name: string,
path: string,
Function updateTripBasic
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func updateTripBasic(updatedTrip wings.TripBasic) bool {
existingTrip, _ := fetchTripBasic(updatedTrip.GetID())
if existingTrip.GetID() != updatedTrip.GetID() {
logger.Print(
logger.Database,
Function getParamRoute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getParamRoute(path: string, file: string): string {
if (file.substring(0, 1) !== "v") {
return "";
}
Function storeObj
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected storeObj(
fetchedObj: FetchedObjStatic<T, FO>,
cacheStorage: CacheStorageStatic<T, CS>,
key: string,
value: string,
Function getModuleInfo
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getModuleInfo(name string, gmod *golistobj) gopkg {
var mod golistobj
if gmod == nil {
res := runNoPanic("go", "list", "--json", name)
if len(res) == 0 {
Function init
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func init() {
configs := config.GetConfigStringMap("email")
if !hasConfig {
return
Function processDirectDeps
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
func processDirectDeps(directDeps []string) {
pkgs := make(map[string]gopkg)
processed = make(map[string]string)
var wg sync.WaitGroup
for _, name := range directDeps {
Function genRun
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function genRun(config: AltimeterConfig): Promise<void> {
let browser: Browser;
switch (config.browser) {
case BrowserTypes.Chromium:
browser = await chromium.launch();
Function toDay
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public toDay(): Day {
const ret = new Day();
ret.ID = this.ID;
ret.tripID = this.tripID;
ret.dayOf = this.dayOf;
Function processDirectDeps
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func processDirectDeps(directDeps []string) {
pkgs := make(map[string]gopkg)
processed = make(map[string]string)
var wg sync.WaitGroup
for _, name := range directDeps {
- 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 genObjImpl
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected async genObjImpl(
fetchedObj: FetchedObjStatic<T, FO>,
cacheStorage: CacheStorageStatic<T, CS>,
key: string,
): Promise<FO> {
- 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 constructor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public constructor(day: Day) {
this.ID = day.ID.valueOf();
this.tripID = day.tripID.valueOf();
this.dayOf = day.dayOf.valueOf();
this.propPlaces = day.places.map((place, index) => {
- 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
Avoid deeply nested control flow statements. Open
if (General.confirmed()) {
next(R.getNext(to));
} else {
next();
}
Avoid deeply nested control flow statements. Open
if (General.authSession()) {
next(R.getNext(to));
} else {
next();
}
Function init
has 6 return statements (exceeds 4 allowed). Open
func init() {
configs := config.GetConfigStringMap("email")
if !hasConfig {
return