Showing 605 of 958 total issues
Function readUtah
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private readUtah(row: number, column: number, numRows: number, numColumns: number): number {
let currentByte = 0;
if (this.readModule(row - 2, column - 2, numRows, numColumns)) {
currentByte |= 1;
}
Function readCorner1
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private readCorner1(numRows: number, numColumns: number): number {
let currentByte = 0;
if (this.readModule(numRows - 1, 0, numRows, numColumns)) {
currentByte |= 1;
}
Function readCorner4
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private readCorner4(numRows: number, numColumns: number): number {
let currentByte = 0;
if (this.readModule(numRows - 3, 0, numRows, numColumns)) {
currentByte |= 1;
}
Function readCorner2
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private readCorner2(numRows: number, numColumns: number): number {
let currentByte = 0;
if (this.readModule(numRows - 3, 0, numRows, numColumns)) {
currentByte |= 1;
}
Function decodeNumericSegment
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static decodeNumericSegment(bits: BitSource,
result: StringBuilder,
count: number /*int*/): void /*throws FormatException*/ {
// Read three digits at a time
while (count >= 3) {
Function handleEOD
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleEOD(context: EncoderContext, buffer: StringBuilder): void {
const unwritten = Math.floor((buffer.length() / 3) * 2);
const rest = buffer.length() % 3;
const curCodewordCount = context.getCodewordCount() + unwritten;
Function getEndMode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getEndMode(): Mode {
if (this.mode === Mode.EDF) {
if (this.characterLength < 4) {
return Mode.ASCII;
}
Function encodeMaximal
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
encodeMaximal(context: EncoderContext): void {
const buffer = new StringBuilder();
let lastCharSize = 0;
let backtrackStartPosition = context.pos;
let backtrackBufferLength = 0;
Function shiftToModuleCenter
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private shiftToModuleCenter(points: ResultPoint[]): ResultPoint[] {
// A..D
// | :
// B--C
let pointA = points[0];
Function getBlackRow
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public getBlackRow(y: number /*int*/, row: BitArray): BitArray /*throws NotFoundException*/ {
const source = this.getLuminanceSource();
const width = source.getWidth();
if (row === undefined || row === null || row.getSize() < width) {
row = new BitArray(width);
Function getCornerFromArea
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private getCornerFromArea(left: number, right: number, top: number, bottom: number, maximizeX: boolean, maximizeY: boolean): ResultPoint {
let resX = maximizeX ? 0 : Number.MAX_VALUE;
let resY = maximizeY ? 0 : Number.MAX_VALUE;
for (let x = left; x < right; x++) {
for (let y = top; y < bottom; y++) {
Function getBullsEyeCorners
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private getBullsEyeCorners(pCenter: Point): ResultPoint[] {
let pina = pCenter;
let pinb = pCenter;
Function encodeMinimally
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static encodeMinimally(input: Input): Result {
/* The minimal encoding is computed by Dijkstra. The acyclic graph is modeled as follows:
* A vertex represents a combination of a position in the input and an encoding mode where position 0
* denotes the position left of the first character, 1 the position left of the second character and so on.
* Likewise the end vertices are located after the last character at position input.length().
Function lookup
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static lookup(
dataCodewords: number,
shape = SymbolShapeHint.FORCE_NONE,
minSize: Dimension = null,
maxSize: Dimension = null,
Function getDataMaskBit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static getDataMaskBit(maskPattern: number /*int*/, x: number /*int*/, y: number /*int*/): boolean {
let intermediate: number; /*int*/
let temp: number; /*int*/
switch (maskPattern) {
case 0:
Function correctTopRight
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private correctTopRight(points: ResultPoint[]): ResultPoint {
// A..D
// | :
// B--C
let pointA = points[0];
Function readVersion
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public readVersion(): Version /*throws FormatException*/ {
if (this.parsedVersion !== null && this.parsedVersion !== undefined) {
return this.parsedVersion;
}
Function removeIncorrectCodewords
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private removeIncorrectCodewords(codewords: Codeword[], barcodeMetadata: BarcodeMetadata): void {
// Remove codewords which do not match the metadata
// TODO Maybe we should keep the incorrect codewords for the start and end positions?
for (let codewordRow /*int*/ = 0; codewordRow < codewords.length; codewordRow++) {
let codeword: Codeword = codewords[codewordRow];
Function convertUPCEtoUPCA
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static convertUPCEtoUPCA(upce: string): string {
// the following line is equivalent to upce.getChars(1, 7, upceChars, 0);
const upceChars = upce.slice(1, 7).split('').map(x => x.charCodeAt(0));
const result: StringBuilder = new StringBuilder(/*12*/);
result.append(upce.charAt(0));
Function createDecoder
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createDecoder(information: BitArray): AbstractExpandedDecoder {
try {
if (information.get(1)) {
return new AI01AndOtherAIs(information);