ryu1kn/vscode-annotator

View on GitHub

Showing 5 of 5 total issues

Function provide has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    provide() {
        const highlightColour = this._configStore.getExtensionConfig('annotationHighlightColor');
        return `
            var vscode = acquireVsCodeApi();
            var stylesheet = document.styleSheets[0];
Severity: Major
Found in src/lib/annotation-script-provider.ts - About 3 hrs to fix

    AppIntegratorFactory has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class AppIntegratorFactory {
        private readonly _extensionContext: any;
        private _annotateCommand: AnnotateCommand;
        private _changedFilePicker: ChangedFilePicker;
        private _configStore: ConfigStore;
    Severity: Minor
    Found in src/lib/app-integrator-factory.ts - About 2 hrs to fix

      Function _getFixedStyle has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _getFixedStyle() {
              const config = this._configStore;
              const fontFamily = config.getEditorConfig('fontFamily');
              const fontSize = config.getEditorConfig('fontSize');
              const lineHeight = config.getEditorConfig('lineHeight');
      Severity: Major
      Found in src/lib/annotation-style-builder.ts - About 2 hrs to fix

        Function _parseChangeEntry has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _parseChangeEntry(entry) {
                const columns = entry.split('\t');
                const changeType = columns[0].charAt(0);
                switch (changeType) {
                case 'A':
        Severity: Minor
        Found in src/lib/changed-file-list-parser.ts - About 1 hr to fix

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

              _getQueryParams(uri) {
                  if (uri.scheme === 'file') {
                      return {
                          path: uri.fsPath,
                          _ts: this._getCurrentDate()
          Severity: Minor
          Found in src/lib/uri-service.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

          Severity
          Category
          Status
          Source
          Language