microting/ngx-charts

View on GitHub

Showing 204 of 204 total issues

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

  update(): void {
    super.update();

    this.dims = calculateViewDimensions({
      width: this.width,
Severity: Minor
Found in src/bubble-chart/bubble-chart.component.ts - About 1 hr to fix

    Function update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      update(): void {
        super.update();
    
        this.dims = calculateViewDimensions({
          width: this.width,
    Severity: Minor
    Found in src/line-chart/line-chart.component.ts - About 1 hr to fix

      Function scaleText has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        scaleText(element, repeat: boolean = true): void {
          let el;
          let resizeScale;
          if (element === 'value') {
            el = this.valueTextEl;
      Severity: Minor
      Found in src/gauge/linear-gauge.component.ts - About 1 hr to fix

        Function roundedRect has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function roundedRect(x, y, w, h, r, [tl, tr, bl, br]: boolean[]) {
          let retval = '';
        
          w = Math.floor(w);
          h = Math.floor(h);
        Severity: Minor
        Found in src/common/shape.helper.ts - About 1 hr to fix

          Function update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            update(): void {
              super.update();
          
              if (!this.showDataLabel) {
                this.dataLabelMaxHeight = { negative: 0, positive: 0 };
          Severity: Minor
          Found in src/bar-chart/bar-vertical-2d.component.ts - About 1 hr to fix

            Function update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              update(): void {
                super.update();
            
                this.dims = calculateViewDimensions({
                  width: this.width,
            Severity: Minor
            Found in src/tree-map/tree-map.component.ts - About 1 hr to fix

              Function update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                update(): void {
                  super.update();
              
                  this.dims = calculateViewDimensions({
                    width: this.width,
              Severity: Minor
              Found in src/area-chart/area-chart.component.ts - About 1 hr to fix

                Function generateData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function generateData(seriesLength: number, includeMinMaxRange: boolean, dataPoints: number = 5): MultiSeries {
                  const results: MultiSeries = [];
                
                  const domain: Date[] = []; // array of time stamps in milliseconds
                
                
                Severity: Minor
                Found in demo/data.ts - About 1 hr to fix

                  Function update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    update(): void {
                      super.update();
                  
                      this.dims = calculateViewDimensions({
                        width: this.width,
                  Severity: Minor
                  Found in demo/bubble-chart-interactive/bubble-chart-interactive.component.ts - About 1 hr to fix

                    Function projectComponentBindings has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                      projectComponentBindings(component: ComponentRef<any>, bindings: any): ComponentRef<any> {
                        if (bindings) {
                          if (bindings.inputs !== undefined) {
                            const bindingKeys = Object.getOwnPropertyNames(bindings.inputs);
                            for (const bindingName of bindingKeys) {
                    Severity: Minor
                    Found in src/common/tooltip/injection.service.ts - About 1 hr 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

                    Function calculateViewDimensions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function calculateViewDimensions({
                      width, height, margins, showXAxis = false, showYAxis = false, xAxisHeight = 0,
                      yAxisWidth = 0, showXLabel = false, showYLabel = false, showLegend = false,
                      legendType = ScaleType.ordinal, legendPosition = LegendPosition.right, columns = 12
                    }): ViewDimensions {
                    Severity: Minor
                    Found in src/common/view-dimensions.helper.ts - About 1 hr 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

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

                      update(): void {
                        super.update();
                    
                        if (!this.showDataLabel) {
                          this.dataLabelMaxHeight = { negative: 0, positive: 0 };
                    Severity: Minor
                    Found in src/bar-chart/bar-vertical-stacked.component.ts - About 1 hr to fix

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

                        getCalendarData(): any[] {
                          // today
                          const now = new Date();
                          const todaysDay = now.getDate();
                          const thisDay = new Date(now.getFullYear(), now.getMonth(), todaysDay);
                      Severity: Minor
                      Found in demo/app.component.ts - About 1 hr to fix

                        Function update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          update(): void {
                            this.updateGradients();
                        
                            const line = this.getLineGenerator();
                        
                        
                        Severity: Minor
                        Found in src/polar-chart/polar-series.component.ts - About 1 hr to fix

                          Function update has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            update(): void {
                              super.update();
                              this.dims = calculateViewDimensions({
                                width: this.width,
                                height: this.height,

                            Function update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              update(): void {
                                super.update();
                            
                                if (!this.showDataLabel) {
                                  this.dataLabelMaxWidth = { negative: 0, positive: 0 };
                            Severity: Minor
                            Found in src/bar-chart/bar-horizontal-2d.component.ts - About 1 hr to fix

                              Function getXDomain has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                getXDomain(): any[] {
                                  let values = getUniqueXDomainValues(this.results);
                              
                                  this.scaleType = getScaleType(values);
                                  let domain = [];
                              Severity: Minor
                              Found in src/line-chart/line-chart.component.ts - About 1 hr to fix

                                Function getXDomain has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  getXDomain(): any[] {
                                    let values = getUniqueXDomainValues(this.results);
                                
                                    this.scaleType = getScaleType(values);
                                    let domain = [];
                                Severity: Minor
                                Found in src/area-chart/area-chart.component.ts - About 1 hr to fix

                                  Function getXDomain has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    getXDomain(): any[] {
                                      let values = getUniqueXDomainValues(this.results);
                                  
                                      this.scaleType = getScaleType(values);
                                      let domain = [];
                                  Severity: Minor
                                  Found in src/area-chart/area-chart-stacked.component.ts - About 1 hr to fix

                                    Function throttle has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function throttle(func: any, wait: number, options?: any) {
                                      options = options || {};
                                      let context;
                                      let args;
                                      let result;
                                    Severity: Minor
                                    Found in src/utils/throttle.ts - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language