catarse/catarse.js

View on GitHub
legacy/src/vms/projects-explore-vm.ts

Summary

Maintainability
D
1 day
Test Coverage

File projects-explore-vm.ts has 432 lines of code (exceeds 250 allowed). Consider refactoring.
Open

type ExtendedWindow = {
    replaceDiacritics(inputText : string): string;
}

import _ from 'underscore'
Severity: Minor
Found in legacy/src/vms/projects-explore-vm.ts - About 6 hrs to fix

    ProjectsExploreViewModel has 42 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class ProjectsExploreViewModel {
    
        private _observer : Observer<Query>;
        private _categories : Category[];
        private _mode : Mode;
    Severity: Minor
    Found in legacy/src/vms/projects-explore-vm.ts - About 5 hrs to fix

      Function loadProjects has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private loadProjects(model, parameters : Object = {}) : ViewModel<Project> {
              model.pageSize(9);
              if (this._searchParam) {
                  return new SinglePageViewModel(async () => {
                      const projectsFound = await this.makeProjectsSearch()
      Severity: Minor
      Found in legacy/src/vms/projects-explore-vm.ts - About 1 hr to fix

        Function mountQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private mountQuery() {
        
                const query : Query = { }
        
                if (this._mode !== 'all_modes') {
        Severity: Minor
        Found in legacy/src/vms/projects-explore-vm.ts - About 25 mins to fix

        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

        There are no issues that match your filters.

        Category
        Status